LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Excel VBA - Excel crashes when macro button re-assigned problem

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
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
How to remove assigned button in from Macro in Excel 2007 Iraj Excel Discussion (Misc queries) 3 March 13th 09 05:52 PM
Macro assigned to a button Sadcrab Excel Discussion (Misc queries) 12 December 8th 06 11:16 PM
Macro Assigned to a Button zephyr Excel Discussion (Misc queries) 1 October 25th 06 03:33 PM
How do I know what macro is assigned to a button? Denise in NC Excel Discussion (Misc queries) 3 April 3rd 06 02:31 PM
Macro assigned to a button question Anita[_2_] Excel Programming 1 July 30th 03 06:21 PM


All times are GMT +1. The time now is 03:05 AM.

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"