Solved

VBA to automatically save the workbook every 2 minutes

Posted on 2016-11-23
3
43 Views
Last Modified: 2016-11-23
I need help with VBA code, where when the workbook is open it is automatically saved every 2 minutes.

how can i accomplish this?  

thanks for your help.
0
Comment
Question by:excelismagic
3 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41898805
HI,

pls try in the workbook module
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:02:00"), "SaveMe"
End Sub

Open in new window

in a normal module
Sub SaveMe()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True

Application.OnTime Now + TimeValue("00:02:00"), "SaveMe"
End Sub

Open in new window

Regards
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41898897
MS did away with the AutoSave feature a few versions ago, a mistake in my opinion.

There is now the AutoRecover option instead. This creates a backup of the file at the timed interval but doesn't actually overwrite the original file. If Excel then crashes or is brutally closed via Task Manager, when re-opening recent AutoRecovered files will be shown with options for opening them.
0
 
LVL 3

Author Closing Comment

by:excelismagic
ID: 41898921
Thanks so much.

posting another similar question. on how to make this code work on any active workbook.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link Excel Spreadsheet to Access, not using Transferspreadsheet 5 31
Advice in Xamarin 21 57
Split a string in excel 9 34
excel help 4 19
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now