autorun run external macro

How is it possible to run a macro in  another .mvba from the Autorun

I have added some commands: in the Autorun

CadInputQueue.SendCommand "View Off All" 'Turn off all views
CadInputQueue.SendCommand "View On 1" 'Turn View 1 on
CadInputQueue.SendCommand "Window Tile" 'Resize View 1 to fit screen
CadInputQueue.SendCommand "Fit All" 'Start Fit All command
CadInputQueue.SendCommand "Selview 1" 'Apply to View 1

These all work, what I wanted to add was a Macro from Name.mvba and I know it is Module6.SetDefaults        

I can run the macro from the key-in command vba run SetDefaults and it works fine, but I was hoping to add it to the autorun

and eliminate extra commands

Parents
  • How is it possible to run a macro in  another .mvba

    Use CadInputQueue.SendKeyin to replicate what you would type into MicroStation's key-in dialog...

    Dim keyIn As String
    keyIn = "vba run [Name]Module6.SetDefaults"
    CadInputQueue.SendKeyin keyIn

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Richard Phillips 

  • Jon, thank you for the reply

    Is this where I add the above statements ?

    Really was uncertain where to place the answer you were nice enough to answer. Perhaps I should have name(no ext) and the

    statement above 

    Dim keyIn As String
    keyIn = "vba run [Name]Module6.SetDefaults"
    CadInputQueue.SendKeyin keyIn
    Oh, Jon I went ahead and put just RUN VBA RJBP(Which is the name)Module6.setdefaults"
    i HAD ADDED THE Message line and it put Ran AutoRun.mvba but nothing fromModule
    Tried Dim KeyIn As String
    KeyIn = "VBA RUN [RJBP]Module6.SetSDFpreferences"
    CadInputQueue.SendKeyin KeyIn
    I even tried VBA RUN RJBP.Module6.SetSDFpreferences"
    Each time am getting error message VBA INTERFACE error:

    I also move the commands below yours:

    When you can spare me some mover of your valuable time, I would appreciate or anyone else who wants to come in













    Version: MicroStation V8i SS 10

    RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus

Reply
  • Jon, thank you for the reply

    Is this where I add the above statements ?

    Really was uncertain where to place the answer you were nice enough to answer. Perhaps I should have name(no ext) and the

    statement above 

    Dim keyIn As String
    keyIn = "vba run [Name]Module6.SetDefaults"
    CadInputQueue.SendKeyin keyIn
    Oh, Jon I went ahead and put just RUN VBA RJBP(Which is the name)Module6.setdefaults"
    i HAD ADDED THE Message line and it put Ran AutoRun.mvba but nothing fromModule
    Tried Dim KeyIn As String
    KeyIn = "VBA RUN [RJBP]Module6.SetSDFpreferences"
    CadInputQueue.SendKeyin KeyIn
    I even tried VBA RUN RJBP.Module6.SetSDFpreferences"
    Each time am getting error message VBA INTERFACE error:

    I also move the commands below yours:

    When you can spare me some mover of your valuable time, I would appreciate or anyone else who wants to come in













    Version: MicroStation V8i SS 10

    RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus

Children
No Data