ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Override a built-in command with a macro (https://www.excelbanter.com/excel-programming/420472-override-built-command-macro.html)

Robert Schwenn

Override a built-in command with a macro
 
Hi,
I'd like to see a macro running when invoking a built-in command. I.e. when
choosing "File - New" my own macro should run.

I already asked this question on another news group and got the answer, that in
Word, I only have to give my macro the same name as the desired Word command.

This works great - in Word. But is there a similar way in Excel? If yes, how can
I get a list of these commands?


Robert

Jim Thomlinson

Override a built-in command with a macro
 
Word and XL are 2 very different things. In Word you are dealing with
modifications to the Normal.dot which is the starting point of all documents.
XL does not have the same structure. To do what you want will require
creating an addin. Within the addin you need to create an object to listen
for events that the XL application is firing.

Here are a couple of links to get you started...
http://www.cpearson.com/excel/AppEvent.aspx
http://www.cpearson.com/excel/CreateAddIn.aspx
--
HTH...

Jim Thomlinson


"Robert Schwenn" wrote:

Hi,
I'd like to see a macro running when invoking a built-in command. I.e. when
choosing "File - New" my own macro should run.

I already asked this question on another news group and got the answer, that in
Word, I only have to give my macro the same name as the desired Word command.

This works great - in Word. But is there a similar way in Excel? If yes, how can
I get a list of these commands?


Robert



All times are GMT +1. The time now is 05:39 PM.

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