-
Disable macros on opening via Hyperlink
I'm using a hyperlink to open a workbook, then using a variable to go to the correct sheet, but I don't want any macros to run on opening by this method (there is a WorkBook_Open macro).
This doesn't seem to work. Any other ideas?
[vba]
Private Sub Workbook_SheetFollowHyperlink(ByVal sh As Object, ByVal Target As Hyperlink)
Application.EnableEvents = False
ActiveWorkbook.Sheets(sht).Activate
Application.EnableEvents = True
End Sub
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules