Custom Toolbar Manipluation

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
I created a custom toolbar named "sheetScroll"

can I manipulate in a way that it'll only open for this workbook (sample.xls) and not other workbooks?
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

AlexM

Board Regular
Joined
Feb 14, 2007
Messages
132
You can change .Visible property of your toolbar in Workbook_Activate and Workbook_Deactivate events and toolbar will be shown only for your workbook.
 
Upvote 0

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,124
Yes you should be able to put in an Open & Close event on the workbook in question to load / unload the toolbar... where name = sheetScroll (may not need add-in code depends on how you have compiled things I guess)

Code:
Private Sub Workbook_Open()
AddIns("name").Installed = True
Application.CommandBars("name").Visible = True
End Sub

and close

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
AddIns("name").Installed = False
Application.CommandBars("name").Visible = False
End Sub
 
Upvote 0

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,124
you would need to attach the toolbar to the file before distributing (via View -> Toolbars -> Customise)
 
Upvote 0

Forum statistics

Threads
1,191,688
Messages
5,988,082
Members
440,124
Latest member
vincentchu2369

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top