Searcing for an Excel event.

D

Dwipayan Das

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top