View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Wannabe Wannabe is offline
external usenet poster
 
Posts: 6
Default Links broken when spreadsheet emailed

That syntax comes from when I choose customize toolbar and then right click
the toolbar button and select assign macro. Then I can choose to use Macros
in "This Workbook", "all open workbooks", and the one that has my spreadsheet
name.

The reason I picked This Workbook is because since I am using a template, I
cannot know for certain the name of the workbook since the name of new
workbooks based on the template will be prefixed with a number. Am I
incorrect in assuming which I should use?

I am using Excel 2003 if it is different from any other version also.

"Jon Peltier" wrote:

I don't know where this syntax came from:

"ThisWorkbook.MyMacro"

It should be assigned to

"'My Workbook Name.xls'!MyMacro"

Note that the workbook name is surrounded with single quotes if it contains
dashes or spaces.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Wannabe" wrote in message
...
I created a spreadsheet template that has some VBA code in it, then created
two buttons to call the methods. This way, the person did not have to go
to
tools, macros and find the one they needed. But when I emailed the
spreadsheet to the user, they pressed the toolbar button and it held a
reference to my computer instead of the worksheet like I thought. When I
originally set it up, I assigned the toolbar button to
"ThisWorkbook.MyMacro"
and thought this would carry over to another computer without messing up
the
reference. How can I prevent this from happening so a user will not have
to
reassign the toolbar buttons each time it is emailed?