PDA

View Full Version : Solved: Workbooks.Open issue in Excel 2010 (Network Drive)



AdrianK
07-18-2011, 09:26 AM
Hello All,

Not sure it anyone has come accross this problem before?

I am trying to use the following code:

strFOLDER2 is the string folder name
strMONTH is the string format number of the month (e.g. 07)



' Open existing file
Workbooks.Open Filename:="\\SERVER\Folder1\ (file://server/Folder1/)" & strFOLDER2 & _
"\FILENAME - " & strMONTH


The variables contain the correct values and the whole filepath is correct.

The code was written in 2003, but we are currently 'upgrading' to 2010. Works fine in 2003, but in 2010 comes back with a 'Microsoft Excel cannot open the file...' error.

The file is a 2003 file, and this can be manually opened from 2010 without issue, but the macro will not open the file.

I'm hoping i'm missing something really really simple, but have tried all I can think of to sort this. (including using the mapped drive letter rather than the server name).

Can anyone please help?

Cheers,

Adrian

CatDaddy
07-18-2011, 10:43 AM
Application.Workbooks.Open Filename:="O:\\Folder\Folder2\MyWorkbook.xlsx"

this worked to open my network drive files

AdrianK
07-19-2011, 02:57 AM
That works Great, thanks

CatDaddy
07-19-2011, 09:58 AM
That works Great, thanks

it took me forever to figure out why that didnt work...be careful if it is going to a different computer the same share drive might be mapped differently!!!

AdrianK
07-20-2011, 01:12 AM
Yes, I couldnt understand why they would change it and what was missing either.

luckily all network drives are mapped the same way for everyone.

Thanks again.

Adrian