Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Alex
 
Posts: n/a
Default Toolbars and customising

Excel helper

I wrote some code in VBA and then customised my toolbar so that in the
<Data dropdown there was an entry that would activate my code.

I then saved my file and all is fine.

The problem: I only want the entry in the Data menu on the toolbar to appear
when I open that specific workbook. At the minute the entry appears in every
excel workbook that I use.

How do I save an excel workbook so that the toolbar is specific tot hat
workbook? Do I need to use an .xlb extension.

Also I wrote my code as Public sub MyCode(). If I instead use Private will
that solve the problem.?

Any help would be appreciated.

Regards


Alex
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default Toolbars and customising

Hi Alex

Normal you customised on activate and restore when you deactivate the workbook

Use this two events in the Thisworkbook module.

Read more about events on Chip Pearson's site.
http://www.cpearson.com/excel/events.htm


Private Sub Workbook_Activate()
'your code to customise
End Sub

Private Sub Workbook_Deactivate()
'your code to restore
End Sub





--
Regards Ron de Bruin
http://www.rondebruin.nl


"Alex" wrote in message ...
Excel helper

I wrote some code in VBA and then customised my toolbar so that in the
<Data dropdown there was an entry that would activate my code.

I then saved my file and all is fine.

The problem: I only want the entry in the Data menu on the toolbar to appear
when I open that specific workbook. At the minute the entry appears in every
excel workbook that I use.

How do I save an excel workbook so that the toolbar is specific tot hat
workbook? Do I need to use an .xlb extension.

Also I wrote my code as Public sub MyCode(). If I instead use Private will
that solve the problem.?

Any help would be appreciated.

Regards


Alex



  #3   Report Post  
Alex
 
Posts: n/a
Default Toolbars and customising

Ron de Bruin

Thanks for that. I'll try that.

Regards

Alex

"Ron de Bruin" wrote:

Hi Alex

Normal you customised on activate and restore when you deactivate the workbook

Use this two events in the Thisworkbook module.

Read more about events on Chip Pearson's site.
http://www.cpearson.com/excel/events.htm


Private Sub Workbook_Activate()
'your code to customise
End Sub

Private Sub Workbook_Deactivate()
'your code to restore
End Sub





--
Regards Ron de Bruin
http://www.rondebruin.nl


"Alex" wrote in message ...
Excel helper

I wrote some code in VBA and then customised my toolbar so that in the
<Data dropdown there was an entry that would activate my code.

I then saved my file and all is fine.

The problem: I only want the entry in the Data menu on the toolbar to appear
when I open that specific workbook. At the minute the entry appears in every
excel workbook that I use.

How do I save an excel workbook so that the toolbar is specific tot hat
workbook? Do I need to use an .xlb extension.

Also I wrote my code as Public sub MyCode(). If I instead use Private will
that solve the problem.?

Any help would be appreciated.

Regards


Alex




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"