Reputation: 20871
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?
When I go to the definition of Shell
in the malfunctioning database, it goes to VBA.Interaction.Shell
.
I get the correct IntelliSense tooltip for Shell
.
I tried VBA.Shell "notepad.exe"
and VBA.Interaction.Shell "notepad.exe"
without success (same error).
Here are the references that are checked in both databases:
Decompiling did not help.
Upvotes: 0
Views: 194
Reputation: 20871
The culprit was our anti-virus software! UGH!
Why did it work in one database and not the other then? I'm told that years ago, anti-virus exceptions were made for my computer for the one database but not the other.
I recommend that any others who encounter this problem check their anti-virus logs/policies. Also, running the database from another computer with different policies in place might shed some light on the issue faster. In this case, when I used remote desktop to log into a server, I was able to call shell successfully.
Upvotes: 2