|
-
Aug 12th, 2008, 09:24 AM
#25
Thread Starter
Junior Member
Re: How to display ToolBar by Worksheet name
Thanks Again Westconn1 for the information and let me share you with my solution, thanks to you.
Here is what I did: I put the following code under class1 module on xla file:
1. Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
2. Dim ShName,Max
3. Max = Workbooks.Count
4. ShName = (Workbooks(Max).Worksheets(1).Name)
5. If ShName = "MySheet" Then
6. ToolBarAdd
7. Else
ToolBarHide
8. End If
9. End Sub
And its doing the Job !!
now I get the relevant workbook and workheet name since he is max and i can trigger it now due to application events, but I have to write all the functions under Class1 module and I was just wondering if I can use the x variable which I defined as an instance of ApplicationEvents but is located at "workkbook_open" event as you told me ,when I've tried to use it to ask for x.workbook name then the whole problem starts again and I get the "personals.xls" workbook but anyway I am very thankfull
for your patience and efforts and feel very lucky to have your assistance which led me to the solution, finally.
Sincerely Jozef
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|