How to programmatically to add CommandButton1_click event heandler with VB?

  • Thread starter Thread starter jingsheng.zhou
  • Start date Start date
J

jingsheng.zhou

There is a button named CommandButton1 in sheet1 of an excel workbook .
How to programmatically to add CommandButton1_click event heandler with
VB?

I know how to add a macro programmatically using set xlmodule =
xlbook.VBProject.VBComponents.Add and xlmodule.codeModule.AddFromString
strCode, But these doesn't add code into CommandButton1_click Sub.

Thanks,
Gene
 
Best to check with the experts in one of the Office, Excel or VB script
newsgroups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top