ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   diff toolbar for diff workbook (https://www.excelbanter.com/excel-programming/349689-diff-toolbar-diff-workbook.html)

Junior728

diff toolbar for diff workbook
 
Hello,

I am just wondering if i open up A workbook, it will appear A toolbar . if i
open another workbook, it will appear that toolbar for that workbook. Simply
said, just want to make the macro tool buttons independent for each workbook.
It seems the the create toolbar thing is linked to the whole excel program,
see all my toolbars that i have created so far even when i just open up the
exel application without opening any workbook.

Can anyone give some advice on how to make it independent? btw, i did not
know how to write the script for creating toolbar and buttons, i just did it
using the excel "add and remove" button under view toolbar menu.



Kaak[_56_]

diff toolbar for diff workbook
 

You should create your toolbar in the on activate event and delete it i
the
deactivate event

--
Kaa
-----------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...nfo&userid=751
View this thread: http://www.excelforum.com/showthread.php?threadid=49862


Junior728

diff toolbar for diff workbook
 
Hi Kaak,

Thanks for your reply.

wHat do u mean by on activate and deactivitive? i have never come across
this before? can u elaborate further?

"Kaak" wrote:


You should create your toolbar in the on activate event and delete it in
the
deactivate event.


--
Kaak
------------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513
View this thread: http://www.excelforum.com/showthread...hreadid=498624



Kaak[_58_]

diff toolbar for diff workbook
 

The workbook has events of his one.

This code is for the workbook, not in a module or in a sheet.

Private Sub Workbook_Activate()

'MsgBox ("Workbook_Activate")

Call CreateMenu

End Sub

Private Sub Workbook_Deactivate()

'MsgBox ("Workbook_Deactivate")

Call DeleteMenu

End Sub


--
Kaak
------------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513
View this thread: http://www.excelforum.com/showthread...hreadid=498624



All times are GMT +1. The time now is 05:49 PM.

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