shell command

S

seeker

The following code gives me an invalid procedure call or argument error:

strappopen = """c:\program files\microsoft office\office11\msaccess.exe
c:\documents and settings\william
akin\desktop\hackneydbase\customcarcarearchive.mdb"""
Shell strappopen

I have also tried:

strappopen = "c:\program files\microsoft office\office11\msaccess.exe
c:\documents and settings\william
akin\desktop\hackneydbase\customcarcarearchive.mdb"
Shell strappopen

with same result. This is being used to open an archive dbase to view from
a live dbase.
 
D

Douglas J. Steele

Daniel's given you one solution that should work.

The reason why yours didn't work is due to the spaces in the path names.
Your first attempt was close, but you need quotes after msaccess.exe and
before the path to the mdb file:

strappopen = """c:\program files\microsoft office\office11\msaccess.exe""
""c:\documents and settings\william
akin\desktop\hackneydbase\customcarcarearchive.mdb"""
Shell strappopen

Now, that's going to wrap, so it's not going to be obvious what there's.
There are three double quotes in a row at the beginning, two double quotes,
followed by a space, followed by two more double quotes between msaccess.exe
and C:\documents..., and three double quotes at the end. Putting two double
quotes in a row inside a string places a single double quote at the position
in the string.
 

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