Calling an excel 4.0 macro from vba in Excel 2002

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to call an existing excel 4.0 macro in a macro written in vba in excel 2002
The excel 4.0 macros are quite complex so I don't want to convert them
any ideas?
 
You can try using the run command

Run "XL4SheetName!NameOnXL4MacroSheet"

This is supposed to work.
 
Hi Dave,

Never done it myself, but VBA has an ExecuteExcel4Macro method which should
do want you want.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Oops, apparently that is only for built-ins. Found this post by Jim Rech
which explains it

ExecuteExcel4Macro is used only to execute built-in Excel 4 macro functions
not your own XL4 code. To do that from VB you have to Run it:

Run "Macro1!XL4_Code"

Here there is a cell named "XL4_Code" on the XL4 macro sheet named "Macro1".
My XL4 code begins at this cell.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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