The system cannot find the path specified

PTori82

Board Regular
Joined
Dec 5, 2012
Messages
64
I saved a tex file into this directory: H:\ATs\AT 14\MEF. However, when I go to computer, the H: drive is a shared drive. What I see is this: 159th(\\125FW-FS-03)(H:). In VBA I have this formula:

Shell "notepad.exe ""\\125FW-FS-03\159th\H:\ATs\AT14\MEF\MEF Winds2.txt""", vbNormalNoFocus

The purpose of this formula is to retreive data from the directory above by pressing a button in a user form. I keep getting the error: "The system cannot find the path specified". What am I doing wrong?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You either use a UNC path or a mapped drive path. There are advantages and disadvantages to both. With the UNC path, you have assurance that the path will work regardless of what the mapped drive letter is (e.g. if it changes from H: to M: you won't care). This often happens when your office is spread over multiple geographic locations: one city will have a certain default share drive letter, and another city will have a different one. Each time you travel - if you travel - you'll have to make an adjustment. If you share files between offices, you're better off sharing the full UNC path so that nobody has to make an adjustment.

The advantage of a mapped drive is if the IT department upgrades the network infrastructure and adds a folder in the name. For example, let's say they move to a tier system of folder naming. Your UNC path then would change:

from ""\\125FW-FS-03\159thATs\AT14\MEF\MEF Winds2.txt"""

to
""\\125FW-FS-03\Tier2\159th\ATs\AT14\MEF\MEF Winds2.txt"""

if the drive mapping is automatic (as with a logon script), then the mapped drive will continue working, while any UNC references will need to be updated - that can be a long, tedious process.


In any case, you cannot combine the two. It sounds to me like your H:\ is mapped to
\\125FW-FS-03\159th. So you replace any reference to H:\ with its actual full path. In your Shell command, take out the H:\ part, and it should work.

Rich (BB code):
Shell "notepad.exe ""\\125FW-FS-03\159th\ATs\AT14\MEF\MEF Winds2.txt""", vbNormalNoFocus
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

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