run macro from custom menu

  • Thread starter Thread starter ken smith
  • Start date Start date
K

ken smith

XL2000 on W2K - I have a series of menus which load from
personal.xls. One command is to run a macro from a file
that I have open (.OnAction = "TimeTracker_2004.xls!
Process_Weekly_Data"). When called I get an error msg "A
document with the name TimeTracker_2004.xls is already
open." Is this a syntax problem? How can I run the code
without reopening the file?

TIA,
ken
 
In the immediate window in the VBE, check what the onaction property of the
control actually refers to:

? Commandbars("Custom1").Controls(1).OnAction
If the results doesn't match your TimeTracker_2004.xls file, then reset it
to match. I suspect that you have changed the location of the file and
Excel sees the reference and the actual file as being different.

In any event, it might be easiest to delete and recreate the button or just
go ahead and reassign the onAction property with the TimeTracker_2004.xls
file open.
 
Thanks, it took the default file path.
-----Original Message-----
In the immediate window in the VBE, check what the onaction property of the
control actually refers to:

? Commandbars("Custom1").Controls(1).OnAction
If the results doesn't match your TimeTracker_2004.xls file, then reset it
to match. I suspect that you have changed the location of the file and
Excel sees the reference and the actual file as being different.

In any event, it might be easiest to delete and recreate the button or just
go ahead and reassign the onAction property with the TimeTracker_2004.xls
file open.

--
Regards,
Tom Ogilvy




.
 
Back
Top