New VBA won't open file on Network Drive

John Sadler

New Member
Joined
May 1, 2012
Messages
48
Hi folks tried this:

Workbooks.Open Filename:="\\FS01\1300Shared\Marketing Folder\scorecard.xls"

Error: Sorry we couldn't find \\FS01\1300Shared\Marketing Folder\scorecard.xls. It is possible it was moved, renamed or deleted.

Also doesn't work using the Drive letter

Workbooks.Open Filename:="Z:\Marketing Folder\scorecard.xls"

I have other VBA where similar line (see below) is working so I'm baffled

Workbooks.Open Filename:="W:\NPS\Reports\NPS Monthly Snapshots Current FY.xlsm" <<<< This works

Also interesting (for me at least) is that I tried using the Macro Recorder when opening the file and all I got was:

Sub Macro3()
'
' Macro3 Macro
'
End Sub

Hope someone can help me.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi John,

If Z is mapped as \\FS01\1300Shared\Marketing Folder\ it should work.

What happens if you put the mapping into Window Explorer? Is the mapping valid? If so can you see the file "scorecard.xls" (which is a very old version of Excel!!) there?

Robert
 
Upvote 0
What about copying \\FS01\1300Shared\Marketing Folder\ into Windows Explorer and see what that does?
 
Upvote 0
And in that folder you see the file scorecard.xls and if so does it open if you double click on it?
 
Last edited:
Upvote 0
Yep ... opens no problem at all. I tried the VBA with several files and all got the same error

This code, however works

Workbooks.Open Filename:="W:\NPS\Reports\NPS Monthly Snapshots Current FY.xlsm"

Cheers
 
Upvote 0
If you press F2 on the "scorecard.xls" file via Windows Explorer - there's no leading or trailing spaces around the file name?
 
Upvote 0
Also see if the filename is outputted in Col. A of the active sheet via this code:

Code:
Option Explicit
Sub Macro1()
    
    Dim strPath As String
    Dim strFile As String
    Dim lngMyRow As Long
    
    Application.ScreenUpdating = False
    
    strPath = "\\FS01\1300Shared\Marketing Folder\"
    strFile = Dir$(strPath & "*.xls")
    lngMyRow = 2
    
    Do While Len(strFile)
        Range("A" & lngMyRow).Value = strFile
        strFile = Dir$
        lngMyRow = lngMyRow + 1
    Loop
    
    Application.ScreenUpdating = True

End Sub

Robert
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top