ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run macro from custom menu (https://www.excelbanter.com/excel-programming/287997-run-macro-custom-menu.html)

ken smith[_2_]

run macro from custom menu
 
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

Tom Ogilvy

run macro from custom menu
 
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

"ken smith" wrote in message
...
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




ken smith[_2_]

run macro from custom menu
 
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

"ken smith" wrote

in message
...
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



.



All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com