I have the following code assigned to a button in an excel worksheet.
Sub Hyperlink()
Worksheets("Sheet Name").Cells(ActiveCell.Row, 3).Hyperlinks(1).Follow
End Sub
When the button is clicked, excel will open the active row’s attached file. This works fine as long as there is a hyperlink in the active row and the user clicks OK when the warning window pops up.
If possible, How can I:
- Avoid the warning to open the hyperlinked file?
- Avoid, disable, or customize the following error messages.
- Empty row or no hyperlinked file.
- (Run-time error ‘9’: Subscript out of range.)
- Clicking cancel when there is a hyperlinked file.
- (Run-time error ‘-24147467260 (80004004)’: The hyperlink cannot be followed to the destination.)
- Empty row or no hyperlinked file.
Here are screenshots of the pop-up messages.
Thank You.
I also found a way to disable hyperlink warnings here.
Although, I do not want to do this for every user of the workbook…
Display.Alerts=False will not work, otherwise any bad guy could turn off warnings. This might work for you partially.