ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Catch FileSave/Save As/etc... (https://www.excelbanter.com/excel-programming/292317-catch-file-save-save-etc.html)

Sonny Maou

Catch FileSave/Save As/etc...
 
In Word VBA, I can write a

sub FileSave()

or

sub FileSaveAs()

to intercept the file menu "Save" and "Save As..." items and do some
processing prior to the save. What is the analogous method in Excel VBA?


Tom Ogilvy

Catch FileSave/Save As/etc...
 
There isn't one. You can remove the menu item and replace it with your own,
us onkeys to remap and shortcut keys and so forth.

--
Regards,
Tom Ogilvy



"Sonny Maou" wrote in message
...
In Word VBA, I can write a

sub FileSave()

or

sub FileSaveAs()

to intercept the file menu "Save" and "Save As..." items and do some
processing prior to the save. What is the analogous method in Excel VBA?




Tom Ogilvy

Catch FileSave/Save As/etc...
 
There is a beforesave event

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy

"Sonny Maou" wrote in message
...
In Word VBA, I can write a

sub FileSave()

or

sub FileSaveAs()

to intercept the file menu "Save" and "Save As..." items and do some
processing prior to the save. What is the analogous method in Excel VBA?




Sonny Maou

Catch FileSave/Save As/etc...
 
Tom Ogilvy wrote:

There isn't one. You can remove the menu item and replace it with your own,
us onkeys to remap and shortcut keys and so forth.


Why? Why? Why?!?! Does the left hand not know what the right hand is
doing at Mickeysoft?!?! Okay, so Microslop said "Why make it easy?" All
right... let's deal with it.

Is there a library out there already done? I would hate to have to
reinvent the wheel. :)

If not, is it possible to make a customMenu class and then do something
like this:

customMenu.Replace cMWhat:="FileNew", cMWith:="FileNew",
cMCode="myFileNewSub"

Then I'd have to reprogram the keystrokes, right?

<pulling hair out


Sonny Maou

Catch FileSave/Save As/etc...
 
Tom Ogilvy wrote:
There is a beforesave event

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.


That was very helpful. Thanks, Tom!



All times are GMT +1. The time now is 12:14 AM.

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