VBA Error calling Shell(winzip)

L

LarryP

Following line of code is supposed to run a self-extracting WinZip file. It
works fine for a couple hundred users, but I just got a call from one that
gets an "invalid argument" error at this point in the code. Anyone have a
solution or even an explanation? (Same version of MSOffice and Winzip on her
computer as on everyone else's, by the way.)

Call Shell("c:\LOB And Metrics Tools\LOB And Metrics Tools.exe /Auto",
vbNormalFocus)
 
E

ErezM via AccessMonster.com

hi
i dont know the answer, but almost always, when errors suddenly pop up on one
computer and not on the other, the solution lies in the "References..."
dialog opened from vba window

look for missing references and fix them

hope it will solve your problem
Erez
 
T

Tony Toews [MVP]

LarryP said:
Following line of code is supposed to run a self-extracting WinZip file. It
works fine for a couple hundred users, but I just got a call from one that
gets an "invalid argument" error at this point in the code. Anyone have a
solution or even an explanation? (Same version of MSOffice and Winzip on her
computer as on everyone else's, by the way.)

Call Shell("c:\LOB And Metrics Tools\LOB And Metrics Tools.exe /Auto",
vbNormalFocus)

What happens when the user just runs that .exe file themselves?

Now granted this is an exe so the fact that it's Winzip is immaterial.
That said I've had no problems and great success using the free open
source Infozip DLLs. Just put them in the same folder as your FE
MB/MDE.

Compression DLLs, OCXs, etc
http://www.granite.ab.ca/access/compression.htm

Tony
 
D

Douglas J. Steele

Because of the spaces in the path, you need extra quotes in there:

Call Shell("""c:\LOB And Metrics Tools\LOB And Metrics Tools.exe"" /Auto",
vbNormalFocus)

That's three double quotes in a row at the beginning, and two double quotes
in a row after .exe
 
T

Tony Toews [MVP]

Douglas J. Steele said:
Because of the spaces in the path, you need extra quotes in there:

Call Shell("""c:\LOB And Metrics Tools\LOB And Metrics Tools.exe"" /Auto",
vbNormalFocus)

That's three double quotes in a row at the beginning, and two double quotes
in a row after .exe

Good catch. But I wonder why it's working on hundreds of computers
and not the one?

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top