Hyperlink in vba to suit other Pc's opening file

B-Man

Board Regular
Joined
Dec 29, 2012
Messages
185
Office Version
  1. 2019
Platform
  1. Windows
I have created a userform that pops up with a list workbooks to open.
I'm having trouble with the userform hyperlink.
if I hyperlink in a cell it just knows where to point to get to that file but if I type out the link in vba to open it it only works for that 1 PC

the files are in google drive. and even mapping the google drive folder to the same virtual drive letter it wont open as "G:\mydrive\ folder1" cant be found as it changes to "C:\Users\Admin\Google Drive\Folder1" in windows explorer.

I have used this in vba before for the linking to work correctly but i cant see how to do that in the personal.xlsb file and surely there is a better way.
VBA Code:
                    Range("url1").Select ' Named cell "url1"
                    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
                    ActiveWorkbook.Sheets("sheet3").Select


the final kicker I want it as a global macro so the macro will be stored in personal.xlsb
I was thinking about symbolic linking that file to the google drive so then its easier to setup on multiple pcs and the linking might be easier?

1. Get hyperlinking working for multiple PC's
2. have it as a global macro
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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