Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default best way of distributing toolbars

I have a workbook with macros that I need to distribute to users. I'd
like to expose macros through toolbar. At first I thought, I'd just
attach toolbar to workbook, but then I thought of this situation:

book named "test1.xls"
give to user
user saves to d:\temp\test1.xls
user opens and gets toolbar
user decides to move test1.xls to C:\Documents and Settings\joeblow\My
Documents\test1.xls
now buttons on toolbar refer to file that no longer exists

What's the best way to avoid this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default best way of distributing toolbars

Build the commandbars with code in the Workbook_Open event

http://msdn.microsoft.com/library/de...l/ofcmdbar.asp
Command and Menu Bars

--
Regards,
Tom Ogilvy



"sugargenius" wrote in message
oups.com...
I have a workbook with macros that I need to distribute to users. I'd
like to expose macros through toolbar. At first I thought, I'd just
attach toolbar to workbook, but then I thought of this situation:

book named "test1.xls"
give to user
user saves to d:\temp\test1.xls
user opens and gets toolbar
user decides to move test1.xls to C:\Documents and Settings\joeblow\My
Documents\test1.xls
now buttons on toolbar refer to file that no longer exists

What's the best way to avoid this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default best way of distributing toolbars

Thanks Tom, that's just what I needed.

BTW, I used a constant to name my toolbar, and it seems to be
"unavailable" to the Workbook_Close event:

Private Const COMMANDBAR_NAME = "Prep Labor Actuals"

Sub Workbook_Close()
Call RemoveToolBar
End Sub

' this works
Sub RemoveToolBar()
On Error Resume Next
Application.CommandBars("Prep Labor Actuals").Delete
End Sub

' this doesn't work
Sub RemoveToolBar()
On Error Resume Next
Application.CommandBars(COMMANDBAR_NAME).Delete
End Sub

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
Distributing a Cell Value MLCole Excel Worksheet Functions 5 March 7th 06 05:23 PM
Distributing an add in Daniel McCollick Excel Programming 3 June 8th 05 07:30 PM
distributing numbers Neil Excel Discussion (Misc queries) 1 April 15th 05 06:41 PM
Distributing Workbook halem2[_14_] Excel Programming 3 August 25th 04 06:34 PM
distributing add-ins lee hite Excel Programming 6 October 14th 03 09:11 PM


All times are GMT +1. The time now is 12:35 PM.

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

About Us

"It's about Microsoft Excel"