VBA mdl function declaration for mdlSystem_setBatchProcessingState (PROCESSSTATE_Processing, NULL)

Could some kind soul please help me write a VBA function declaration for this undocumented mdl function: "mdlSystem_setBatchProcessingState (PROCESSSTATE_Processing, NULL) ". I keep getting a workspace alert dialog every time a new file is opened when running a VBA batch. My hope is that I can use this function to prevent that. My Micostation version is 10.14.02.01. Thanks.

Parents
  • First, define the possible values of PROCESSSTATE for VBA...

    Public Enum PROCESSSTATE
        PROCESSSTATE_Inactive             = 0
        PROCESSSTATE_Processing           = 1
        PROCESSSTATE_Paused               = 2
        PROCESSSTATE_Done                 = 3
        PROCESSSTATE_Cancelled            = 4
        PROCESSSTATE_OpeningFile          = 5
        PROCESSSTATE_AnalyzeFile          = 6
        PROCESSSTATE_ClosedFile           = 7
    End Enum

    Next, declare the function prototype in VBA...

    Declare PtrSafe Sub mdlSystem_setBatchProcessingState _
        Lib "ustation.dll" _
        (ByVal PROCESSSTATE, ByVal s As LongPtr)

    Now write a VBA wrapper.   I've stolen and adapted this one from 's post...

    Public Sub OpenFileWithoutWorkSetCheck(ByVal fileName As String)
        mdlSystem_setBatchProcessingState PROCESSSTATE_Processing, 0
        OpenDesignFile fileName
        mdlSystem_setBatchProcessingState PROCESSSTATE_Inactive, 0
    End Sub

    The above is all guesswork — I haven't tested it.

     
    Regards, Jon Summers
    LA Solutions

  • Thanks Jon, it's still not working, but you set me in the right direction. I get a runtime error stating "Can't find DLL entry point mdlSystem_setBatchProcessingState in stdmdlbltin.dll". My assumption is the function is not contained in that dll. I'll look around and see if I can figure out which one it is.

    Also, just want to send out a big thanks to you and your website! I starting using Microstation about 8 or 9 years ago and virtually everything I know about Microstation VBA started with your website. You've made me a rockstar among my peers.

Reply
  • Thanks Jon, it's still not working, but you set me in the right direction. I get a runtime error stating "Can't find DLL entry point mdlSystem_setBatchProcessingState in stdmdlbltin.dll". My assumption is the function is not contained in that dll. I'll look around and see if I can figure out which one it is.

    Also, just want to send out a big thanks to you and your website! I starting using Microstation about 8 or 9 years ago and virtually everything I know about Microstation VBA started with your website. You've made me a rockstar among my peers.

Children