Hi Steve! I've tried several different ways of writing this code. When I
use the below code, Excel opens but I get the message I wrote about earlier:
Dim stAppName As String
stAppName = "excel.exe h:\marketing\sales
planning\excel\forms\material_num_Setup.xls"
Call Shell(stAppName, 1)
When I try this different code, I get a "syntax error" message and am sent
directly to the Visual Basic code editor:
Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\excel.exe"
"H:\Marketing\Sales Planning\Excel\Forms\materialsetupform.xls"
Since my excel file is on a public drive (H) verses my hard drive (C), I'm
wondering if that's part of the problem. Unfortunately, the file needs to
stay on the H drive. Thanks for all your help
Steve Schapel said:
S. H. Drew,
I can't replicate the problem. This is a common procedure which I have
done many times without incident, so I can't figure it out right at the
moment.
Could you post back with the full Command Line argument setting you are
using.
--
Steve Schapel, Microsoft Access MVP
S. H. Drew said:
Yes, I enclosed the filename in quotes. The message comes up in Excel and it
reads:
The file could not be accessed. Try one of the following:
Make sure the specified folder exists.
Make sure the folder that contains the file is not read-only.
Make sure the filename does not contain any of the following
characters: < > ? [ ] : | or *
Make sure the file/pathname doesn't contain more than 218 characters.
Messages 1, 2 and 4 don't apply as 1)the specified folder does exist, 2) the
file is not read only, and 3) the path/filename isn't more than 218
characters. So I'm guessing the colon is what's throwing it off; I'm
thinking maybe there's some obscure setting in Excel that's causing this.
(I'm using Access and Excel 2003 versions, if that helps).