raymondcidad
New Member
- Joined
- Aug 13, 2008
- Messages
- 2
I´m trying to deactivate or hide some controls in excel with a vb code.
I hide the controls when some sheets are activate with the code:
The problems is that if the sheet is not deactivate, but is the workbook that is deactivate, for example if I change to another workbook, the second code is never run and the controls remain on hide mode.
Im trying to run some code when I change to another woorkbook.
I tried to put the code in the App_WorkbookDeactivate() sub, but that subrutine doesn't run when I change to another workbook.
I also tried
App_WorkbookDeactivate(ByVal Wb As Workbook)
and
Workbook_Deactivate()
I´m placing this code in the sheet code.
Any ideas?
thanks!
I hide the controls when some sheets are activate with the code:
Code:
Private Sub Worksheet_Activate()
'some code. works fine
end sub
and then unhide the controls again with the code
Code:
Private Sub Worksheet_Deactivate()
'some code. works fine.
end sub
The problems is that if the sheet is not deactivate, but is the workbook that is deactivate, for example if I change to another workbook, the second code is never run and the controls remain on hide mode.
Im trying to run some code when I change to another woorkbook.
I tried to put the code in the App_WorkbookDeactivate() sub, but that subrutine doesn't run when I change to another workbook.
Code:
Private Sub App_WorkbookDeactivate()
'Code never run!
end sub
I also tried
App_WorkbookDeactivate(ByVal Wb As Workbook)
and
Workbook_Deactivate()
I´m placing this code in the sheet code.
Any ideas?
thanks!