Archive of Mr Excel Message Board

Back to Other Office and Excel archive index
Back to archive home

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:
=SET.NAME("FileNm",GET.DOCUMENT(88))
=RUN(vbCreate)
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.

Re: Variable Scope - XLM Macro calling VBA Macro
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)")
Ivan

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.