ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbooks.Open with a network path (https://www.excelbanter.com/excel-programming/441653-workbooks-open-network-path.html)

Peter[_66_]

Workbooks.Open with a network path
 
Hello

I'm trying to do a Set SrcWrkBook = Workbooks.Open(\\networkdrive\ folder
one\ folder two\filename.XLS, True, True)

I assume the white spaces and perhaps the \\ are giving me issues. How do
I get around this?




Rick Rothstein

Workbooks.Open with a network path
 
That first argument (your path and filename) needs to be a String value, so
it needs quote marks around it. Also, I'd be willing to bet that there are
no leading spaces in front of your folder names. My guess is your line
should look like this (note, this line is long, so I expect it will word
wrap at a required blank space)...

Set SrcWrkBook = Workbooks.Open("\\networkdrive\folder one\folder
two\filename.XLS", True, True)

--
Rick (MVP - Excel)



"Peter" wrote in message
...
Hello

I'm trying to do a Set SrcWrkBook = Workbooks.Open(\\networkdrive\ folder
one\ folder two\filename.XLS, True, True)

I assume the white spaces and perhaps the \\ are giving me issues. How
do I get around this?





All times are GMT +1. The time now is 11:14 AM.

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