Open file that has A Hash (#) Sign in the File Name

samahiji

Board Regular
Joined
Oct 6, 2015
Messages
82
Office Version
  1. 2019
Platform
  1. Windows
Hi
I just noticed that Excel hyperlink won't be able to open a file that has pound sign (Hash #) in the file name.
One solution is to rename those files. However, I have so many files with (#) in their name which not possible solution.

Any thought on how to solve this issue?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Research & find code that loops through folders and renames the files by removing the octothorpe (#)?
Or use some other method that uses regular vba or Microsoft Scripting Runtime.
 
Upvote 0
What type of hyperlinks are they? Created with the HYPERLINK function or inserted via the Insert Link dialogue?

There is a trick using the FollowHyperlink event, but this is fired only for the second type of hyperlink, and only after Excel has attempted to open the file. The trick - Disable Hyperlink From Opening Until Confirmed - OzGrid Free Excel/VBA Help Forum - requires that the 'Text to Display' of each hyperlink is the full file name of the hyperlinked file and the hyperlink is changed from 'Existing File or Web Page' to 'A Place in This Document' and refer to the cell of the hyperlink itself and use the ScreenTip property as the file reference. With this, Excel thinks it is an internal hyperlink and we can use the FollowHyperlink event to intercept the click, extract the file reference and open the file. Hyperlinks using the HYPERLINK function must be changed to the Insert Link method and then the same trick can be used.
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,984
Members
449,092
Latest member
Mr Hughes

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