Runs a VBA macro from
the Application object.
Signature
VBA :
object.RunMacro(MacroPath)
VL : (vl-RunMacro
object MacroPath)
(vla-RunMacro applic
"test.dvb!Module1.macro")
-
Object :
Application
The object or objects this method applies to.
-
MacroPath :
String; input-only
A string representing the calling sequence of the macro to run. The
calling sequence must have the following syntax, where [] represent
optional parameters:
[Filename.dvb.][ProjectName.][ModuleName.]MacroName
NOTE: If Filename.dvb is followed by ProjectName, separate
the names with an exclamation point instead of a period, as in the
following example:
Filename.dvb!ProjectName
The Filename.dvb specified will be loaded if it is not already
loaded. If the path to the Filename.dvb is not specified, the system
will look in the AutoCAD search path to try and locate the file. If
ProjectName is not specified, the system will search all currently
loaded projects to locate the macro.
Remarks
To associate a macro with
a popup menu or toolbar item, use the Macro property
Example :
(defun c:al-runmacro ()
(vl-load-com)
(setq applic (vlax-get-acad-object))
(vla-RunMacro applic "test.dvb!Module1.macro")
(princ)
);defun
|
|