Automating Excel from VB 6

  • 14 years ago

    I have a VB 6 project where I open an Excel worksheet. On that worksheet, there is a button that runs a macro. I don't know how to either: 1) click the button programmatically from VB or 2) run the Excel macro from VB. Any ideas would be greatly appreciated. Thank you!

  • 14 years ago

    I don't know how to click the button, but running the assigned macro is pretty straightforward:

    oExcel.Run ("YourMacroName")

    Where oExcel is the instance of the Excel-object.

    I hope this helps,

    Erwin

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Never trust a programmer in a suit.” - Anonymous