Pete_Bristol
Board Regular
- Joined
- Mar 8, 2006
- Messages
- 122
Dear All,
Please can you help with a simple(?) problem I am having.
The following code works perfectly on a workbook that has been opened exclusively by one person. Essentially, the user has clicked a hyperlink on a summary page and the macro unhides and selects the relevant sheet.
However, when the workbook is opened by another person as read-only (i.e the first person is still in it), this macro (and infact lots of others, all with select statements in them) fails with the message "select method worksheet class failed" and then "unable to set the visible property".
I am sure I have done this millions of times before without problem. Why wont it allow me to select the sheet when the workbook is readonly? Incidentally, the spreadsheet is simply a reporting spreadsheet no input is actually made in it.
Please can you advise what I am missing or why it wont work.
Many thanks,
Pete
Please can you help with a simple(?) problem I am having.
The following code works perfectly on a workbook that has been opened exclusively by one person. Essentially, the user has clicked a hyperlink on a summary page and the macro unhides and selects the relevant sheet.
However, when the workbook is opened by another person as read-only (i.e the first person is still in it), this macro (and infact lots of others, all with select statements in them) fails with the message "select method worksheet class failed" and then "unable to set the visible property".
Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
Dim sName As String
sName = Left(Target.SubAddress, (InStr(1, Target.SubAddress, "!") - 1))
Worksheets(sName).Visible = True
Worksheets(sName).Select
End Sub
I am sure I have done this millions of times before without problem. Why wont it allow me to select the sheet when the workbook is readonly? Incidentally, the spreadsheet is simply a reporting spreadsheet no input is actually made in it.
Please can you advise what I am missing or why it wont work.
Many thanks,
Pete