Shell statement

E

Eric

My shell statement target path is not interpretting the
folder name "Test Reports" correctly with the space
between Test and Reports. It interprets the application
path fine. What should I do and why?

Dim RetVal
Dim strPath,strFileName
strFileName = Left$(strCustomer,6) & strRptDate
strPath = "C:\Program Files\Microsoft
Office\Office\excel.exe M:\Test Reports\" & strFileName
& ".xls"
RetVal = Shell(strPath, 1)
 
D

Dirk Goldgar

Eric said:
My shell statement target path is not interpretting the
folder name "Test Reports" correctly with the space
between Test and Reports. It interprets the application
path fine. What should I do and why?

Dim RetVal
Dim strPath,strFileName
strFileName = Left$(strCustomer,6) & strRptDate
strPath = "C:\Program Files\Microsoft
Office\Office\excel.exe M:\Test Reports\" & strFileName
& ".xls"
RetVal = Shell(strPath, 1)

Try this:

strPath = _
"C:\Program Files\Microsoft Office\Office\excel.exe " & _
Chr(34) & "M:\Test Reports\" & strFileName & ".xls" & Chr(34)
 

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