ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error opening file (https://www.excelbanter.com/excel-programming/325853-error-opening-file.html)

Stuart[_21_]

Error opening file
 
This code sequence worked fine sometime ago, but not now.

ChDir "C:\BofQProject\QSBofQ\"
Workbooks.Open Filename:="NewQSBofQ.xls", _
Editable:=False

The error is reporting that the file could not be found, and yet it is
clearly there. The path and filename are correct.

What might be happening, please?

Regards.



Stuart[_21_]

Error opening file
 
Just a little further information:

I copied the filename (without quotes) from the code,
clicked StartSearchAll files and folders and then pasted it into the box.
Clicked Search.

It listed the file in: C:\BofQProject\QSBofQ.


"Stuart" wrote in message
...
This code sequence worked fine sometime ago, but not now.

ChDir "C:\BofQProject\QSBofQ\"
Workbooks.Open Filename:="NewQSBofQ.xls", _
Editable:=False

The error is reporting that the file could not be found, and yet it is
clearly there. The path and filename are correct.

What might be happening, please?

Regards.




Dave Peterson[_5_]

Error opening file
 
Maybe you were on a different drive.

I'd add:
chdrive "C:"
before the chdir line.

Stuart wrote:

Just a little further information:

I copied the filename (without quotes) from the code,
clicked StartSearchAll files and folders and then pasted it into the box.
Clicked Search.

It listed the file in: C:\BofQProject\QSBofQ.

"Stuart" wrote in message
...
This code sequence worked fine sometime ago, but not now.

ChDir "C:\BofQProject\QSBofQ\"
Workbooks.Open Filename:="NewQSBofQ.xls", _
Editable:=False

The error is reporting that the file could not be found, and yet it is
clearly there. The path and filename are correct.

What might be happening, please?

Regards.


--

Dave Peterson


All times are GMT +1. The time now is 02:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com