View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Tendresse Tendresse is offline
external usenet poster
 
Posts: 117
Default Paths for macros

Hi Earl, thanks for your reply. Much appreciated.
You are right, when i save as, it seems that the buttons in the customised
tool bar get linked to the newly created file.

Well, because i have so many macros included in this workbook (16 macros), i
don't think that using keyboard shortcuts will appeal to the users. They
won't like to memorise what each shortcut does. I liked the idea of having
all the commands in drop down menus in one customised toolbar. More
userfriendly.

As for using control buttons inside the worksheets, i tried this idea at the
very beginning (before i discovered that i could customise my own toolbars).
The problem with using control buttons is that i'll need 16 buttons! Because
the calendar spreads across the worksheet, i can't keep the 16 buttons
visible on the screen at all times while scrolling, even when i have the
freeze panes on.

So this leaves me with the option of saving the macros in a separate
workbook. I'll try this idea and see how i go.

To make sure i got it correctly, what i need to do is to delete the macros
in the original file 'Calendar' and save them in a whole new workbook, say
"Master".
And in this case the customised tool bar will only have one source to get
the macros from no matter how many times i save 'Calendar' as. Right?

i'll give it a go and let you know ..

Thanks a million, Earl. you have been very helpful :)

Tendresse





"Earl Kiosterud" wrote:

Tendresse,

To understand better what happens, try this. Assign your toolbar button to a macro in
Calendar, then save and close Calendar. Now if you click the button, it'll open Calendar,
because that's where the macro lives. When you do the Save As, the button link, like most,
gets updated. Now it wants to open Test.

Presumably, it's Calendar you're going to be saving-as. If so, you could use a keyboard
shortcut key to fire the macros instead. The save-as won't destroy the original assignment
to the macro in Calendar, although the saved-as files will also have the macros, and will
respond to the keyboard shortcuts when open. Also, the saved-as workbooks will get the
macro warning when opened. If the macros should be there (saved from Calendar), then fine.
I don't know if only the original Calendar is supposed to have them, or any saved-as copy.

If the macros were only supposed to be in the original (Calendar) workbook, you might
consider having a separate workbook that has the macros, and saves-as (I'm making up save-as
words as I go along) Calendar, which won't contain the macro. Then you could use any old
way to fire the macros -- toolbar buttons, worksheet buttons, keyboard shortcuts.

If any saved-as workbook is supposed to have all the macros, including the save-as macro,
then consider using buttons from the Autoshapes toolbar, on worksheets, assigned to macros.
They stay with the workbook, unaffected by save-ases. There's another one.
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Tendresse" wrote in message
...
Hi all,
My spreadsheet seems to have a problem finding macros. I'm not sure how this
happened, so i'll try to explain what i did and hopefully someone can give me
a clue on where i went wrong.
- I created a spreadsheet (called 'Calendar'), added a few macros to it and
saved it on our network.
- I also created a new customised toolbar for that spreadsheet. This toolbar
has a few menu items to which i assigned the macros.
- The purpose of one of these macros is to create a new calendar for the new
year. It first displays the 'Save As' dialogue box so the user can choose a
new name for the new calendar, then the macro clears the contents that were
entered from the previous year.
- When i tested this macro and was prompted to Save As, i saved the file as
'Test' on my desktop.
- Then I deleted the 'Test' file and opened my original file 'Calendar' to
add some more few things.
- But now when i try to use my toolbar i get a message saying that 'Test.xls
is not found'.
- I went to my menu items in the customised toolbar and checked the 'Assign
Macro' option and found that the 'Macro Name' refers to the 'Test' file that
i saved then deleted from the desktop!

I can't understand why this happened. All macros were working fine before i
created the 'Test' file. I need help on how to fix this problem.
I want to be able to 'Save As' my original file and still be able to use the
customised toolbar for all original and saved-as documents. Is this possible?

Thanks in advance
Tendresse