hexagon logo

Server Busy error during VBA automation

I have some Excel VBA code that I can call from a PC-DMIS script and it will pull data out of PC-DMIS, manipulate it, and then push it back in. If I generate any message boxes in Excel while this is happening I will get a Server Busy error message if the user doesn't respond to the message box within a few seconds. Does anyone know how to disable this message? I just want it to wait as long as necessary for Excel to finish what it is doing.
Parents
  • I think I might have a solution. Those of you who know about such things please comment on the benefits/pitfalls of the following:

    - Using a PC-DMIS script to call an external script causes problems with the COM server if there is too much time delay for the external script to finish. I have been unable to find a way to extend the COM server timeout. If someone knows how to do this it seems like the best solution.

    - In the absence of a way to prolong the COM timeout I can use the external command function in PC-DMIS with "Wait" specified.

    - To do this I call a .bat file from the PC-DMIS command and pass the arguments to the .bat file.

    - The .bat file then calls a VBScript file that looks almost exactly like the script that I was running through the PC-DMIS scripting engine originally. The vbscript received the arguments from the .bat file and the uses Select Case to branch off the first argument to call the correct subroutine. This subroutine then calls the correct excel macro.

    It seems like a long way around but it also seems to work. Anybody have a better solution?

    Update:
    It is confirmed that using the external command with "wait" argument solves the issue with the COM timeout. It seems like it might run a bit faster as well...
Reply
  • I think I might have a solution. Those of you who know about such things please comment on the benefits/pitfalls of the following:

    - Using a PC-DMIS script to call an external script causes problems with the COM server if there is too much time delay for the external script to finish. I have been unable to find a way to extend the COM server timeout. If someone knows how to do this it seems like the best solution.

    - In the absence of a way to prolong the COM timeout I can use the external command function in PC-DMIS with "Wait" specified.

    - To do this I call a .bat file from the PC-DMIS command and pass the arguments to the .bat file.

    - The .bat file then calls a VBScript file that looks almost exactly like the script that I was running through the PC-DMIS scripting engine originally. The vbscript received the arguments from the .bat file and the uses Select Case to branch off the first argument to call the correct subroutine. This subroutine then calls the correct excel macro.

    It seems like a long way around but it also seems to work. Anybody have a better solution?

    Update:
    It is confirmed that using the external command with "wait" argument solves the issue with the COM timeout. It seems like it might run a bit faster as well...
Children
No Data