Solid Edge Framework Type Library
RunMacro Method
Specifies the complete path and file name of the macro file that is to be run.
Description
Executes a specified macro.
Syntax
Visual Basic
Public Sub RunMacro( _
   ByVal Filename As String _
) 
Parameters
Filename
Specifies the complete path and file name of the macro file that is to be run.
Remarks
The macro name can be specified as either a file name or as the programmatic identifier of a Visual Basic OLE Automation server. Control returns to the caller as soon as the macro has been launched and activated. This implies that the macro has not necessarily completed running. In addition, launching a macro causes any running commands to be terminated.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    Call objDoc.Close
    ' Run a macro
    Call objApp.RunMacro(Filename:="T:\vbtests\TestCases\ATPMacro.exe")

    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
End Sub
See Also

Application Object  | Application Members