0

I would like to generate an excel spread sheet with c# that contain a button, and that I can handle the event when the user click on this button...

Any idea please...

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Mallouli Boulbeba
  • 381
  • 1
  • 3
  • 10
  • You want the button in Excel spreadsheet or generate the spreadsheet with button or what ? – klm_ Nov 22 '10 at 09:53

2 Answers2

0

Check this thread. It may be helpful. There is a lot of references to excel libs.

Community
  • 1
  • 1
klm_
  • 1,199
  • 1
  • 10
  • 26
0

There's not much information to go on here, but my guess is that you need to do something similar to "create a button with macro from code module programmatically".

Basically, you will need to create the button and insert the vba linked to the button.

Also take note of the difference between a CommandButton and a FormsButton. The former already has an event attached to it. This is the same type of button as described in the link above. So if you create a button named called 'myVBAButton', the corresponding subroutine that it automatically linked to the click event would look like

Private Sub myVBAButton_Click() 

End Sub

Remember, you still need to add the above code from your the code that creates the button.

Ahmad
  • 22,657
  • 9
  • 52
  • 84