Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toolbar Problems
Hello,
I'm hoping that somebody will be able to help me, with this particular issue. I have created an Excel Toolbar and assigned a number of macros to the Toolbar. However when I move the Excel file, from a development folder to a production folder, the toolbar doesn't run the macros anymore and says that the macros cannot be found e.g. Toolbar looking for the original Excel file in the development folder. Is their anyway round this, so that the Toolbar will always run the macros contained within the opened Excel file? Thanks. Stefan. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toolbar Problems
Hi Stefan,
I'm hoping that somebody will be able to help me, with this particular issue. I have created an Excel Toolbar and assigned a number of macros to the Toolbar. However when I move the Excel file, from a development folder to a production folder, the toolbar doesn't run the macros anymore and says that the macros cannot be found e.g. Toolbar looking for the original Excel file in the development folder. Is their anyway round this, so that the Toolbar will always run the macros contained within the opened Excel file? Here is a small tutorial about toolbars. Soon, my site will contain a full article on things like this: www.jkp-ads.com/Articles/DistributeMacro00.htm 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 Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Toolbar problems | Excel Discussion (Misc queries) | |||
Adjusting toolbar size, restore toolbar | Excel Discussion (Misc queries) | |||
Excel Standard Toolbar button addition/removal problems? | Excel Discussion (Misc queries) | |||
Text to Speech toolbar problems | Excel Worksheet Functions | |||
saving toolbar buttons on custom toolbar | Excel Programming |