If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Where is toolbar info stored ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-08-06, 23:08
Jim Wright Jim Wright is offline
Registered User
 
Join Date: Oct 2004
Location: Melbourne, Australia
Posts: 201
Where is toolbar info stored ?

A client has upgraded his PC to XP and asked me to review and modify some Excel spreadsheets whose templates were created c. 1997 !
I rejigged the macros in VBA, but could not modify the command buttons on a toolbar, so I deleted hem and added my own to the same toolbar. Most of the code is in personal.xls, so that the functionality can be shared among a family of spreadsheets. However, after porting the new personal.xls and the revised templates to the client's machine, the old buttons were still visible.

I then deleted the old toolbar in its entirety and created a new toolbar (with a different name) and command buttons in personal.xls. I emailed the file to the client and instructed him to remove the original toolbar and add my new one (via views/toolbars). He reports that he cannot see my new toolbar on the list, though I can on my machine.

Where is the toolbar physically stored and how do I get it to my client ?
Reply With Quote
  #2 (permalink)  
Old 05-09-06, 02:44
Fazza Fazza is offline
Registered User
 
Join Date: Feb 2006
Posts: 113
Hi Jim,

Toolbars are stored in *.xlb files. According to my Walkenbach book, for non network users this will be in Windows' main directory. The book also notes that a toolbar that's attached to a workbook automatically appears when the workbook is opened, unless the workspace already has a toolbar by the same name. Sounds like what you're experiencing.

Maybe your client needs a one-off deletion of the old toolbar so the new one that you sent with the workbook takes effect. I think this can be simply done from your clients machine in the VBE's immediate window, Application.CommandBars("The Toolbar Name").Delete

If is it not convenient to open the VBE from Excel on the client's machine, you could email a temporary file with that line of code to execute when the workbook opens & then close/delete that temporary file. Open the other file with the new toolbar and it should be OK.

Normally when using custom toolbars in a spreadsheet, standard practice is to (On Error Resume Next) delete the custom toolbar when the workbook opens (just in case it was already there), then create the toolbar on the fly, hide the toolbar whenever the workbook is deactivated, unhide when activated, delete when the workbook closes.

HTH,
Fazza
Reply With Quote
  #3 (permalink)  
Old 05-09-06, 17:51
Jim Wright Jim Wright is offline
Registered User
 
Join Date: Oct 2004
Location: Melbourne, Australia
Posts: 201
Thanks, Fazza,
You have confirmed what I already suspected. As it happens the client has asked for a couple of amendments, so it is convenient to go and create the new toolbar on his machine. However, the idea of managing the toolbars through VBE is quite neat and I will keep it for future reference.
Regards,
Jim Wright.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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