MarredCheese
MarredCheese

Reputation: 20871

Access VBA: Shell command broken in one particular database

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

Upvotes: 0

Views: 194

Answers (1)

MarredCheese
MarredCheese

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

Related Questions