Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 97
All of a sudden I am getting the above error on an existing workbook when activating and deactivating worksheets using VBA e.g. Private Sub CommandButton3_Click() Worksheets("WABC").Visible = True Worksheets("WABC").Select End Sub The above procedure has worked previously and I cannot understand why this is happening. Any help would be appreciated. Thanks Shal |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try changing the .takefocusonclick property to False for your commandbutton.
or add activecell.activate near the top of your code This is a bug in xl97 that was fixed in xl2k. Shalin Chopra wrote: Excel 97 All of a sudden I am getting the above error on an existing workbook when activating and deactivating worksheets using VBA e.g. Private Sub CommandButton3_Click() Worksheets("WABC").Visible = True Worksheets("WABC").Select End Sub The above procedure has worked previously and I cannot understand why this is happening. Any help would be appreciated. Thanks Shal -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Is the workbook (rather than the worksheet) protected? You can't change the structure of the workbook (like making a sheet visible) if it is. regards Paul (Shalin Chopra) wrote in message . com... Excel 97 All of a sudden I am getting the above error on an existing workbook when activating and deactivating worksheets using VBA e.g. Private Sub CommandButton3_Click() Worksheets("WABC").Visible = True Worksheets("WABC").Select End Sub The above procedure has worked previously and I cannot understand why this is happening. Any help would be appreciated. Thanks Shal |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you all for your help. The workbook had inadvertently been
protected and this was the cause of this error. Works perfectly now. Cheers Shal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error 1004: Unable to get the axis property | Charts and Charting in Excel | |||
VBA error: Unable to set the Values property of the Series class | Charts and Charting in Excel | |||
Error 1004 - unable to set the orientation of the page setup class | Excel Programming | |||
Unable to set the colorIndex Property of the Interior Class Error | Excel Programming | |||
HELP!! Excel 2000 Copy of worksheet class failed run time Error 1004 | Excel Programming |