ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically adding checkbox and attaching event handlers (https://www.excelbanter.com/excel-programming/412342-programmatically-adding-checkbox-attaching-event-handlers.html)

guest

Programmatically adding checkbox and attaching event handlers
 
Hello. I need programmatically add CheckBox to the worksheet and then attach
event handlers using C#. Any ideas? I am using Microsoft.Office.Interop.Excel
library to do that. Unfortunately I have to use only interop library to do
that. Any help would be appreaciated.

thanks.

SteveM

Programmatically adding checkbox and attaching event handlers
 
On Jun 10, 1:42 pm, guest wrote:
Hello. I need programmatically add CheckBox to the worksheet and then attach
event handlers using C#. Any ideas? I am using Microsoft.Office.Interop.Excel
library to do that. Unfortunately I have to use only interop library to do
that. Any help would be appreaciated.

thanks.


Better to just create the checkbox with its code and toggle .Visible
True/False.

SteveM

guest

Programmatically adding checkbox and attaching event handlers
 
I create the worksheet programmtically. So there is no design time support.

"SteveM" wrote:

On Jun 10, 1:42 pm, guest wrote:
Hello. I need programmatically add CheckBox to the worksheet and then attach
event handlers using C#. Any ideas? I am using Microsoft.Office.Interop.Excel
library to do that. Unfortunately I have to use only interop library to do
that. Any help would be appreaciated.

thanks.


Better to just create the checkbox with its code and toggle .Visible
True/False.

SteveM


Dave Peterson

Programmatically adding checkbox and attaching event handlers
 
Chip Pearson shares some VBA techniques for writing code that writes code.
http://www.cpearson.com/excel/vbe.aspx

Have you thought of creating a template workbook that's set up exactly the way
you want, then using that in your code to create the worksheet.

You could even use a hidden worksheet as your template--or an external workbook
if you wanted.

guest wrote:

I create the worksheet programmtically. So there is no design time support.

"SteveM" wrote:

On Jun 10, 1:42 pm, guest wrote:
Hello. I need programmatically add CheckBox to the worksheet and then attach
event handlers using C#. Any ideas? I am using Microsoft.Office.Interop.Excel
library to do that. Unfortunately I have to use only interop library to do
that. Any help would be appreaciated.

thanks.


Better to just create the checkbox with its code and toggle .Visible
True/False.

SteveM


--

Dave Peterson


All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com