Forum Discussion

tzsabre's avatar
tzsabre
Copper Contributor
Jan 31, 2023
Solved

MacOS issue VBA with Workbooks.Open

At work, we use Google Drive for Desktop and up until recently could use a script that included the line to find a file path in the computer was a Mac.

ElseIf Dir("/Volumes/GoogleDrive/Shared drives/etc.) <> "" Then

 

Last week Google Drive for Desktop had to move to Locations to stay compliant with MacOS. The line above no longer works with this change and I cannot figure out what the new file path could be. So for MacOS what would the file path be to open a workbook with Workbooks.Open if the workbook is in "Locations" outside of Macintosh HD?

  • After opening a workbook from that location you could open the VBE and open theimmediate window and then write:
    ?ActiveWorkbook.Path
    and hit Enter. That should give you the location.

1 Reply

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    After opening a workbook from that location you could open the VBE and open theimmediate window and then write:
    ?ActiveWorkbook.Path
    and hit Enter. That should give you the location.

Resources