Local or Network drive

gnissen

New Member
Joined
Jun 27, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi all, I have a bunch of files users can open on a network drive. But we have a fair amount of trouble accessing thus drive /G:\PVC\XXXX, so I run the same thing from my local drive C;\ PVC\XXXX.
how can you using vba do the following. If I open the main file C:\TEMPLATES.XLSM which holds all the macros going to different files when you press the macro button.
If I open the main file in C all other files will point to C.
If I open it in G, all other files will point to G.
Regards
Greg
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
On workbook opening, get the drive letter - left(activeworkbook.Path,1) and assign to a global variable. All your code would have to reference the global variable value in any hard drive path references. Or don't use C or G in your code; use relative paths. That means instead of using hard coded paths use something like ActiveWorkbook.Path, or ActiveWorkbook.FullName. Either way, it probably means you'd have to edit all of your code.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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