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