Hi Everyone,
I'm wondering if there's a way to create a VBA that will automatically open a "save as" dialogue box whenever a workbook is opened. I am trying to prevent users from overwrittting old versions.
Thanks!
Hi Everyone,
I'm wondering if there's a way to create a VBA that will automatically open a "save as" dialogue box whenever a workbook is opened. I am trying to prevent users from overwrittting old versions.
Thanks!
iit'd be better to use code for workbook beforeclose event.
The attached will auto save the file in the Documents folder. File named: Backup.xlsm
It autosaves when the file is opened without the user being aware (ScreenUpdates and Alerts are set to False; then turned back on once the file is saved).
Each time it autosaves the previous backup version is overwritten (replaced with the newer version).
Code in ThisWorkBook module initiates the macro upon workbook opening to create the backup. Code in the routine module does the actual backup.
In ThisWorkBook:
In regular Module:Please Login or Register to view this content.
Please Login or Register to view this content.
Thanks for that! However, I was hoping to write something that actually launches a "save as" dialogue box as soon as the workbook is opened so that person using it can save the new version with the updated date each time a change is made.
That's not a bad idea but I can't think of how I could do that!
Hello enwoznick,
What if when the "save as" dialogue box appears and the user simply hits the cancel button?
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
I misunderstood your intentions. Since you were not wanting the user to by-pass the process, made it completely automatic.
Here's another version.
Some of the code in this http://www.vbaexpress.com/forum/show...-not-filled-in would apply to your situation.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
The link I posted is the wrong one.
Perhaps if you put this in the ThisWorkbook code module, it would do what you want.
Please Login or Register to view this content.
This works great! Thanks so much!
Elise
Hey Logit, this has been working great. Thanks again. I'm wondering if there is a way to modify this to automatically make the "save as" name combine combine the contents of a certain cell and the date. I'm guessing this would be pretty tricky but wondering if you have any thoughts!
Using this code in the ThisWorkBook module / Close Event:
The code auto saves the file with the extension : Today's date and the time of saving (includes hours / minutes / seconds) so the file can be saved continuously without overwriting previous versions.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks