Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xla question

Does anyone know how to create a toolbar that will run
some code in an .xla? I want this toolbar to be
displayed when the add-in is loaded (checked) and go away
when the add-in is unloaded (unchecked). Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default xla question

Hi Phill,

Does anyone know how to create a toolbar that will run
some code in an .xla? I want this toolbar to be
displayed when the add-in is loaded (checked) and go away
when the add-in is unloaded (unchecked).


Excel keeps toolbar and menubar customizations in a file with the
extension .xlb. The exact filename depends on Excel version and
install, but usually is: Excel9.xlb or Excel.xlb or Username8.xlb.
Often this file can be found in your WINDOWS directory.

You can attach a toolbar to a workbook. When this workbook is loaded,
XL checks if the toolbar is on the system. If not, it copies the
toolbar from the workbook to the system.

After creating *or changing* the toolbar, you should attach the toolbar
to your workbook:

- activate the workbook to which you want to attach the toolbar
- Rightclick the toolbar, select 'customize'
- Click 'Attach' (Toolbars Tab)
- If the workbook already contains a toolbar by that name, delete it
first by clicking on it on the righthand side and choosing Delete.
- Select your toolbar (on the left) and press 'copy'
- Save the workbook (optionally: save_as an add-in).

Also, you should include code that deletes the toolbar when your
workbook or add-in is closed, so that when you deliver a new version of
your workbook the new toolbar will be used i.s.o the old one. You can
do that in the Thisworkbook module, using the Workbook_BeforeClose
event:

Private Sub Workbook_BeforeClose(Cancel as Boolean)
On Error Resume Next 'In case Toolbar is absent
Application.CommandBars("YourBarsName").Delete
End Sub

After that you save the workbook as filetype Add-in and you're done.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default xla question

Thanks. My toolbar is available but is not visible until
I selected it. It deletes just fine. Is there a way to
get the toolbar to be visible by default? Thanks again.

-----Original Message-----
Hi Phill,

Does anyone know how to create a toolbar that will run
some code in an .xla? I want this toolbar to be
displayed when the add-in is loaded (checked) and go

away
when the add-in is unloaded (unchecked).


Excel keeps toolbar and menubar customizations in a file

with the
extension .xlb. The exact filename depends on Excel

version and
install, but usually is: Excel9.xlb or Excel.xlb or

Username8.xlb.
Often this file can be found in your WINDOWS directory.

You can attach a toolbar to a workbook. When this

workbook is loaded,
XL checks if the toolbar is on the system. If not, it

copies the
toolbar from the workbook to the system.

After creating *or changing* the toolbar, you should

attach the toolbar
to your workbook:

- activate the workbook to which you want to attach the

toolbar
- Rightclick the toolbar, select 'customize'
- Click 'Attach' (Toolbars Tab)
- If the workbook already contains a toolbar by that

name, delete it
first by clicking on it on the righthand side and

choosing Delete.
- Select your toolbar (on the left) and press 'copy'
- Save the workbook (optionally: save_as an add-in).

Also, you should include code that deletes the toolbar

when your
workbook or add-in is closed, so that when you deliver a

new version of
your workbook the new toolbar will be used i.s.o the old

one. You can
do that in the Thisworkbook module, using the

Workbook_BeforeClose
event:

Private Sub Workbook_BeforeClose(Cancel as Boolean)
On Error Resume Next 'In case Toolbar is absent
Application.CommandBars("YourBarsName").Delete
End Sub

After that you save the workbook as filetype Add-in and

you're done.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
SUM(IF) question shaunap Excel Discussion (Misc queries) 5 June 21st 06 06:21 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


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

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"