Get the Excel Filename after a save

  • Thread starter Thread starter Remy
  • Start date Start date
R

Remy

Hello,
I need a way to figure out under what filename someone saved his
spreadsheet.
I basically would need an event like AfterSave (as there is one called
BeforeSave). I know that I could emulate the save behaviour in
BeforeSave and just return cancel, but I would rather not do that,
specially with all the filetypes that some excel versions support and
others dont'.
I also know that with ActiveWorkbook.FullName I can get that name, but
I'm not sure at which point I should do that?
Is there an event that gets called after a save happend or how can I do
this?

Thanks

Remy
 
Perhaps, use the BeforeClose event to compare the current filename with a
stored value?

HTH,
Bernie
MS Excel MVP
 
You could grab the filename on the "Workbook Deactivate" event. This i
assuming that they saved it..
 
Remy,

I thin you are going to have to take that approach in some form. If the
workbook has already been saved before, you can get the fullname at that
point, if it hasn't, you could throw up a GetSaveAsFilename dialog and get
the name and then save, then cancel.
 
If they don't save the workbook then I also don't need the filename, so
that is ok.
Initially I wanted to have the filename registered the first time they
save it (even if they don't close the spreadsheet), but I guess it's
good enough if I update the filename once they close it.

The reason I don't like the GetSaveAsFilename approach is that this
macro should work for different excel versions, without really limiting
the users, and it gets a big complicated when I also have to figure out
what file types all the Excel versions support.

Thanks a lot for the help guys
 
Back
Top