MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Variable Scope - XLM Macro calling VBA Macro

Posted by Bill on September 22, 2000 11:11 AM

I have a worksheet with macros written in XLM - the old Excel 4 macro language. The XLM code sets a variable and then later calls my VBA program:

From within the VBA program, is there any way to expose the XLM variables so I can get the data in the VBA program?

It appears to me that the SET.NAME actually sets up a name in the Insert Names box, but I can not seem to access it from VBA.

Any help would be appreciated.

Posted by Ivan Moala on September 22, 2000 1:15 PM

The XLM macro is actually setting the variable
named "FileNm" to the name of the active workbook in the form "Book1".

To get the same value in VBA then use

FileNm = ExecuteExcel4Macro("GET.DOCUMENT(88)")