JeffT
02-20-2005, 02:08 PM
Hi
I've read a few posts on this subject and suspect I have the same problem. I would like confirmation and / or suggestions of possible solutions.
I've made a custom toolbar using tools / Customise / Toolbars, Added the buttons changed the images and assigned Macros from 'This workbook'.
All works fine unless I change the filename. I've found the Macro is renamed on saving Filename.xls'!Macroname. If I move the file the Macro reference starts from C: ..... to the old location.
I had Previously written a VBA macro which worked but could only use the built in faces.
First is their anyway to make the current toolbar Macro references relative?
Will the code at the bottom of this post work? I copied from a previous post but haven't had time to do the Lemon test.
Alternatively how do I assign the images I created on the new toolbar to my old toolbar? I've saved them in a hidden sheet in the workbook (though the sizes were enlarged slightly) so that I could paste them into a help file. If I can get this to work my project will be done!
Thanks for all your help so far.
Jeff T
Option Explicit
Sub MyMacro()
Dim FName AsString
FName = ThisWorkbook.FullName
'Your code here...
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=FName
Application.DisplayAlerts = True
End Sub
I've read a few posts on this subject and suspect I have the same problem. I would like confirmation and / or suggestions of possible solutions.
I've made a custom toolbar using tools / Customise / Toolbars, Added the buttons changed the images and assigned Macros from 'This workbook'.
All works fine unless I change the filename. I've found the Macro is renamed on saving Filename.xls'!Macroname. If I move the file the Macro reference starts from C: ..... to the old location.
I had Previously written a VBA macro which worked but could only use the built in faces.
First is their anyway to make the current toolbar Macro references relative?
Will the code at the bottom of this post work? I copied from a previous post but haven't had time to do the Lemon test.
Alternatively how do I assign the images I created on the new toolbar to my old toolbar? I've saved them in a hidden sheet in the workbook (though the sizes were enlarged slightly) so that I could paste them into a help file. If I can get this to work my project will be done!
Thanks for all your help so far.
Jeff T
Option Explicit
Sub MyMacro()
Dim FName AsString
FName = ThisWorkbook.FullName
'Your code here...
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=FName
Application.DisplayAlerts = True
End Sub