ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searcing for an Excel event. (https://www.excelbanter.com/excel-programming/413627-searcing-excel-event.html)

Dwipayan Das

Searcing for an Excel event.
 
Hi

I am working on a ADD-IN for excel.I have requirement as follows.

1) I have created a Excel command bar and created some command butttons on
it.
2) Button Start is a default command button which gets loaded with other
buttons and shown to the user (Visble=true) and other buttons are hidden
(visible=false).
3) The other buttons gets visible on some condtion i.e if a sheet named
mySettings gets loaded to the workbook then they will appear to the workbook
otherwise they will disapper (hideen).
4) I am searcing a event that will fire and search for the perticaulr sheet
in workbook and gets activate and deactivate the command buttons on the
command bar.

If i am missing something then plz let me know so that i can make it more
presise.

Thanks

__Das

Bob Phillips

Searcing for an Excel event.
 
Here's an example


Public WithEvents App As Application

Private Sub App_SheetActivate(ByVal Sh As Object)

With Application.CommandBars("Worksheet Menu Bar").Controls("MyMenu")

.Controls("myButton").Visible = Sh.Name = "mySheet"
End With

End Sub

Private Sub Workbook_Open()
Set App = Application
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dwipayan Das" wrote in message
...
Hi

I am working on a ADD-IN for excel.I have requirement as follows.

1) I have created a Excel command bar and created some command butttons
on
it.
2) Button Start is a default command button which gets loaded with other
buttons and shown to the user (Visble=true) and other buttons are hidden
(visible=false).
3) The other buttons gets visible on some condtion i.e if a sheet named
mySettings gets loaded to the workbook then they will appear to the
workbook
otherwise they will disapper (hideen).
4) I am searcing a event that will fire and search for the perticaulr
sheet
in workbook and gets activate and deactivate the command buttons on the
command bar.

If i am missing something then plz let me know so that i can make it more
presise.

Thanks

__Das





All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com