Programmatically adding checkbox and attaching event handlers

  • Thread starter Thread starter guest
  • Start date Start date
G

guest

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.
 
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
 
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.
 
Back
Top