View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Help: Can open a spreadsheet in a folder which contains spaces in the folder name!

This works fine, so spaces in the file path is not your problem:

Dim strTemp As String
strTemp = "C:\Documents and Settings\Nick\Desktop\Book5.xls"
Workbooks.Open (strTemp)

Is this on an English language OS ?

NickHK

"1tsols" wrote in
message ...

Tim Williams Wrote:
So what happens when thev file doesn't open?
Any error?

Tim

"1tsols" wrote in
message
...


IsFile() is a generic routine to check that the file exists before
attempting to open the file with excel.



--
1tsols

------------------------------------------------------------------------
1tsols's Profile:

http://www.excelforum.com/member.php...o&userid=36430
View this thread:

http://www.excelforum.com/showthread...hreadid=561976


If I enclose the path & filename in quotes Excel says it can't find the
file and to ensure that the file exists and the spelling is correct.

If I don't enclose the path & filename in quotes Excel then splits the
path & filename where there are spaces and then complains it can't find
the file(s).

For example, C:\Documents and Settings\JHP\My Documents\excel.xls

Without quotes I get the following messages:
'C:\Documents.xls' could not be found
'and.xls' could not be found
'Settings\JHP\My.xls' could not be found
'Documents\excel.xls' cound not be found

In quotes I get:
Run-time Error 1004: '"C:\Documents and Settings\JHP\My
Documents\excel.xls"' can not be found. check spelling and verify the
location.

The unregserver / regserver commands and the "Ignore other
applications" options doesn't solve this.

Hope this helps.


--
1tsols
------------------------------------------------------------------------
1tsols's Profile:

http://www.excelforum.com/member.php...o&userid=36430
View this thread: http://www.excelforum.com/showthread...hreadid=561976