I have two Access databases that I'm opening on the same computer. In one, running this in the immediate window works as expected (opens Notepad):
Shell "notepad.exe"
In the other, I get this error instead:
Run-time error '5': Invalid procedure call or argument
I have not been able to come up with any shell command that will run successfully in that second database. No matter what, I get that error.
What is going on here? Could there be a security setting coming into play? Or perhaps one is an older version?
Edit - More Info
When I go to the definition of
Shell
in the malfunctioning database, it goes toVBA.Interaction.Shell
.I get the correct IntelliSense tooltip for
Shell
.I tried
VBA.Shell "notepad.exe"
andVBA.Interaction.Shell "notepad.exe"
without success (same error).Here are the references that are checked in both databases:
Decompiling did not help.