I found the following macro code online that seems to do what I am looking for, which is to present an Input Box to select multiple cells at once which contain hyperlinks to open other Excel documents, either locally on my computer, or located on a network share.
My local files are opened via the macro just fine, but none of the network files (using the UNC path to the file) are opening, but instead throwing the Run-time error '13': Type mismatch error.
I believe that the cause of the error is due to the fact that there is a comma in the network share path name. When I created a local file path, also with a comma in it, I am getting the same Runtime error for a file that would otherwise open for a path that does not contain a comma. (I do not have access to a network share that does not have at least one comma in the path name.) When I clicking on the links one at a time they will open the files just fine, but the macro, in its current state, cannot.
An generic example of the local hyperlink would be:
=HYPERLINK("C:\Users\Name\Desktop\Offline Data Files\Biller, Name\Client TEST - Biller\Billing\2021\Client Template.xlsx","Client Comma in Local File Path Test")
When I click on the debug button in the error message box, it highlights the following line in the code:
url = Evaluate(Left(c.Formula, InStr(1, c.Formula, ",") - 1) & ")")
Now I do not know anything about VBA coding, so I am not able to discern what exactly is causing the error in that line, but I think it might have something to do with the "," that comes after the second occurrence of "c.Formula".
My question is, is it possible to overcome this, or is it just not possible to open a file on a path that contains one or possible more commas in it using VBA? Thank you.
Bookmarks