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.
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.
Share Improve this question asked Jan 20 at 12:45 Gener4torGener4tor 3883 gold badges13 silver badges47 bronze badges1 Answer
Reset to default 0With:
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.