Simon.
Comments? it's 3 lines of code??!!
get the onaction string
instrrev (not available in xl97) finds the position of the last
occurance of the "!"
mid takes the string from that position to the end
(which should result in the string pointing to the procedure)
append thisworkbook.name to the beginning and assign the string to the
original onaction.
In general:
select a word you dont recognize.
Press F1 and help will tell you.
If you want to see what happens when it executes:
Make sure the "Locals" pane is visible.
Then select the line inside the loop and press f9
(this is called a breakpoint , line will be red)
run the procedure, it will stop on the red line.
Now look in the locals pane to the value of your variables.
Further studying: Help topics on debugging
Re not centralizing code:
I dont know your situation. Cant judge.
But:
I would still make all efforts to centralize code in 1 or 2 addins.
I would NEVER have a fixed toolbar and reassign the procedures.
I would ALWAYS build my menus on the fly.
Re mail:
nope. not interested.
keepITcool
< email : keepitcool chello nl (with @ and .)
< homepage:
http://members.chello.nl/keepitcool
Simon Lloyd wrote:
KeepItCool,
Thanks again for the advice, i don't think i can have one workbook
with
all macro's in because not everyone who will be able to access these
workbooks (which are in the same folder) will have the same access
rights (these are set by the network Administrator as lots of machines
are in general use rather than private) so it may cause an error when
caling on something more than they have been allowed!
Also the code you have kindly supplied......could you add some
comments
so i know whats happening as the code is being executed?
if you would like i can send you one of my smaller workbooks (around
500Kb) so you can see my code and new menubar.
Simon
---
Message posted from http://www.ExcelForum.com/