vbawindowsms-accessoffice365

Why I cant start Remote Assistance (msra.exe) via vba "shell" since Win 11/Office 365 update?


This is the code I use (from ms-access):

Dim commandLine As String
commandLine = "msra.exe /offerRA " & par_terminalId
Call Shell(commandLine, vbNormalFocus)

If I c&p the content of "command line" (e.g. "msra.exe /offerRA TFQ8") into cmd it works. If I try it with the above code in vba the result is:

Err.Number: 5
err.descrition: "Invalid procedure call or argument"

So what has changed? Until our Win 11/Office 365 update the same code worked fine.


Solution

  • With:

      Dim wsh As Object
      Set wsh = CreateObject("WScript.Shell")
      Call wsh.Run(commandLine)
    

    it works fine. The problem seems to be with the shell-command specificly.