ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove the filename when assign a macro to a menu command. (https://www.excelbanter.com/excel-programming/334245-remove-filename-when-assign-macro-menu-command.html)

OKLover[_2_]

Remove the filename when assign a macro to a menu command.
 
When i assign a macro to the menu command's button. it always shows the macro
name with the filename of workbook. ex: C:\My Project\MyFile0712.xls!macro1

How do I remove the filename name or the path name?


Tom Ogilvy

Remove the filename when assign a macro to a menu command.
 
You don't. The button has to be linked to a specific instance of the macro.

If you mean how do you change it to point to another workbook, you would use
the onaction property of the button.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
When i assign a macro to the menu command's button. it always shows the

macro
name with the filename of workbook. ex: C:\My

Project\MyFile0712.xls!macro1

How do I remove the filename name or the path name?




OKLover[_2_]

Remove the filename when assign a macro to a menu command.
 
Hi, Tom. Thanks for your help.

What i need is assign the macro always to thisworkbook (the workbook contain
the macro), no matter what filename it changed to. Does it possible?



"Tom Ogilvy" wrote:

You don't. The button has to be linked to a specific instance of the macro.

If you mean how do you change it to point to another workbook, you would use
the onaction property of the button.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
When i assign a macro to the menu command's button. it always shows the

macro
name with the filename of workbook. ex: C:\My

Project\MyFile0712.xls!macro1

How do I remove the filename name or the path name?





Tom Ogilvy

Remove the filename when assign a macro to a menu command.
 
Reassign it in the Workbook_Open event using the OnAction property.

No built in support for what you describe. You have to do it with code.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
Hi, Tom. Thanks for your help.

What i need is assign the macro always to thisworkbook (the workbook

contain
the macro), no matter what filename it changed to. Does it possible?



"Tom Ogilvy" wrote:

You don't. The button has to be linked to a specific instance of the

macro.

If you mean how do you change it to point to another workbook, you would

use
the onaction property of the button.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
When i assign a macro to the menu command's button. it always shows

the
macro
name with the filename of workbook. ex: C:\My

Project\MyFile0712.xls!macro1

How do I remove the filename name or the path name?







OKLover[_2_]

Remove the filename when assign a macro to a menu command.
 
so... if i don't write any code in the Workbook_Open event. i must put the
workbook file on the same path folder with mine?

Oooop! i create a workbook and want to distribute to 10 users, i must create
the same folder on every machine.... :~~

"Tom Ogilvy" wrote:

Reassign it in the Workbook_Open event using the OnAction property.

No built in support for what you describe. You have to do it with code.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
Hi, Tom. Thanks for your help.

What i need is assign the macro always to thisworkbook (the workbook

contain
the macro), no matter what filename it changed to. Does it possible?



"Tom Ogilvy" wrote:

You don't. The button has to be linked to a specific instance of the

macro.

If you mean how do you change it to point to another workbook, you would

use
the onaction property of the button.

--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
When i assign a macro to the menu command's button. it always shows

the
macro
name with the filename of workbook. ex: C:\My
Project\MyFile0712.xls!macro1

How do I remove the filename name or the path name?









All times are GMT +1. The time now is 10:17 AM.

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