Solved

VBA to automatically save the workbook every 2 minutes

Posted on 2016-11-23
3
29 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 48

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 31

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

746 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

13 Experts available now in Live!

Get 1:1 Help Now