Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Toolbars that are not attached will work okay, as long as they point to the
correct version (or revision) of workbook that contains the code that you want to run. If you are still creating data workbooks that contain the macro code, then you will have an impossible job of trying to determine which code will be run when you click the button. In other words, you create Book1 and save it. Later, you add more data and maybe save it as Book2, then decide to make changes to the code. The toolbar button is now referring to the code in Book2. The next time you click it to make changes to the data in Book1 it might actually be running the code in Book2 to make the changes in Book1! This can get very confusing. This is why I usually always put code in a separate workbook. My preference is to attach a toolbar to the workbook that contains the code that the toolbar buttons will call. This way, the workbook with the macro code can be moved to another machine and the toolbar will be displayed (a copy made to the local Excel environment) when the code workbook is opened on that machine. The toolbar that you see next to all of the other toolbars in Excel on your computer is actually a COPY of the toolbar that is attached to the workbook. I know this is difficult for most users to understand and I wish that Microsoft would make toolbars an object that shows up in the project explorer window along with the worksheets, user forms, code modules, charts, class modules, etc. The COPY of the toolbar that you see displayed next to your menu bar can be modified by having extra buttons added (that could even refer to other macros in other workbooks). The origninal toolbar attached to a workbook is NOT automatically updated when the user adds new buttons to the COPY of the toolbar that is displayed. -- Regards, Bill "PaulC " wrote in message ... Bill The workbook crashed with another application error last night during normal data inputting. I am going to try moving the macros to a separate workbook. However, re-reading your suggestions I realise that I have never (knowingly!) attached any of the toolbars to the workbook. They are obviously just stored on the main pc used for data inputting. Apart from making the toolbars available at any other pc is there any need to attach them? Or, could not attaching them be a possible cause of the problems I'm having? I am quite concerned about dealing with these application errors. Obviously if you have any other suggestions for finding the cause of these errors I would be very gratefull. Best wishes, Paul --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to remove assigned button in from Macro in Excel 2007 | Excel Discussion (Misc queries) | |||
Macro assigned to a button | Excel Discussion (Misc queries) | |||
Macro Assigned to a Button | Excel Discussion (Misc queries) | |||
How do I know what macro is assigned to a button? | Excel Discussion (Misc queries) | |||
Macro assigned to a button question | Excel Programming |