J
Joe HM
Hello -
I want to make sure that some buttons on one of the sheets of a
workbook are disabled if the file was opened in read-only. I put the
following in the Activate() handler of that workbook:
Private Sub Worksheet_Activate()
If ThisWorkbook.ReadOnly Then
ThisWorkbook.Sheets("Sheet2").Shapes("xButton").ControlFormat.Enabled =
False
....
The only problem with that is that if the workbook is opened with that
sheet being visible (active) already, it won't work until I switched
sheets and come back to this one.
I tried to put something similiar into the Workbook_Open() handler but
there seems to be a problem since that is called without all the sheets
being loaded. Is there a way I can wait until all the sheets are
loaded in there and then disable my buttons?
Thanks so much!
Joe
I want to make sure that some buttons on one of the sheets of a
workbook are disabled if the file was opened in read-only. I put the
following in the Activate() handler of that workbook:
Private Sub Worksheet_Activate()
If ThisWorkbook.ReadOnly Then
ThisWorkbook.Sheets("Sheet2").Shapes("xButton").ControlFormat.Enabled =
False
....
The only problem with that is that if the workbook is opened with that
sheet being visible (active) already, it won't work until I switched
sheets and come back to this one.
I tried to put something similiar into the Workbook_Open() handler but
there seems to be a problem since that is called without all the sheets
being loaded. Is there a way I can wait until all the sheets are
loaded in there and then disable my buttons?
Thanks so much!
Joe