View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default save command bar into an excel workbook using vb

Commandbars are application level. Once it is created, it is not really
related to the commandbar you attached to your workbook. If you make
changes to it where you are working (where it was created by opening the
workbook). Those changes will be saved automatically.

If you mean you want to change it where you first created it and have it
updated in the workbook where you attached it, I believe you have to do that
manually.


Here is an article which talks about attaching toolbars:

http://www.microsoft.com/exceldev/articles/toolbatt.htm

--
Regards,
Tom Ogilvy


"José Ignacio Bella" wrote in message
...
Hello Tom
I have looked at these articles, but I haven't found what I'm looking for.

I'm working with Excel97. I have built a custom command bar with some
macros, for some friends in the office. The macros code is in an xla.

I have manually saved (joined) this command bar to en excel workbook. If
someone opens the book, the command bar appears, and it remains in Excel
application.

I do not like to create the bar trough code (the bar has custom icons,

etc).
It's easy for me to create it manually

I only wanted to have some code in the book that contains the command bar
(in the Before Close event), to be sure that the bar is always saved after

I
made changes.

Excuse my poor English. I hope it's enought clear. I have posted the same
question in the Spanish Excel forum, but they say I can no join a custom
command bar to a book with code (only manually). That's the reason to post
the question here.

Thxs again!











"Tom Ogilvy" escribió en el mensaje
...
http://support.microsoft.com/?id=159619
XL97: Sample Macros for Customizing Menus and Submenus

http://support.microsoft.com/?id=213550
XL2000: Sample Macros for Customizing Menus and Submenus


http://support.microsoft.com/default...b;en-us;166755
File Title: Customizing Menu Bars, Menus, and Menu Items in Microsoft(R)
Excel 97
File Name: WE1183.EXE
File Size: 58041 bytes
File Date: 06/20/97
Keywords: kbfile kbappnote
Description: This Application Note can help you learn techniques for

writing
Visual Basic(R) for Applications code to customize menus in Microsoft

Excel
97. This Application Note contains code examples that you can use with

the
following elements: menu bars, menus, menu items, submenus, and shortcut
menus.


Should give you the type of information you need.

--
Regards,
Tom Ogilvy

"José Ignacio Bella" wrote in message
...
Hello, I want to save a custom command bar into an excel workbook.
Instead of doing that manually, I want to do with Vb code (before

close,
join the command bar to the book, and delete the bar).

The Vb help says I can do it using the command bar property "context"
<Application.CommandBars("BarName").Context, but I do not know how to

use
context (there is no example).
Does anyone know how to do it?

Thanks in advance