Get the Excel Filename after a save
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 |
Get the Excel Filename after a save
Perhaps, use the BeforeClose event to compare the current filename with a
stored value? HTH, Bernie MS Excel MVP "Remy" wrote in message oups.com... 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 |
Get the Excel Filename after a save
You could grab the filename on the "Workbook Deactivate" event. This i assuming that they saved it.. -- tkstoc ----------------------------------------------------------------------- tkstock's Profile: http://www.excelforum.com/member.php...fo&userid=1444 View this thread: http://www.excelforum.com/showthread.php?threadid=37963 |
Get the Excel Filename after a save
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. -- HTH Bob Phillips "Remy" wrote in message oups.com... 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 |
Get the Excel Filename after a save
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 |
Get the Excel Filename after a save
Try activeworkbook.name
"Remy" wrote: 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 |
All times are GMT +1. The time now is 10:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com