Skip to main content

Forcing Excel to Ask to save file after an interval ...

Hi one and all,
This time I have come up with a macro that will be activated automatically when you open the file and will ask you at regular intervals say 5 minutes, 10 minutes to save your file.

So here are the steps:-
1. Open the Workbook. Press Alt + F11 to open Visual Basic Window.
2. On the Left Side of the Screen, there would be a Thisworkbook Module. Double Click it.
3. Now Copy and Paste the code below there:-

Private Sub Workbook_Open()
Call Ontime
End Sub

4. Now Insert Module from the Insert Menu in the Menu Bar.
5. Copy and Paste the following code there:-

Dim Hours, Minutes, Seconds
Sub Backup()
Ans = MsgBox("Wanna Save the File..?", vbYesNo)
If Ans = vbYes Then ActiveWorkbook.Save
Call Ontime
End Sub

Sub Ontime()
Hours = 0 'Put Hours here
Minutes = 1 'Put Minutes here
Seconds = 0 'Put Seconds here
Application.Ontime Now + TimeSerial(Hours, Minutes, Seconds), "Backup"
End Sub

6. Close the Visual Basic Window and Save the file as Macro Enabled in .xlsm format. ( in .xls for 2003 version)
7. That's it. You can open that file and continue with your work.
8.  Excel will automatically ask to save file after the specified intervals.

Remarks:-
You can always change the interval time by changing the values of Bold variables (Current delay is 1 Minute ). Make sure FPath must end with a "\" sign.

Regards,

File can be downloaded here..

Comments

Popular posts from this blog

Highlighting Duplicates across multiple sheets

Hi One and All, This time I have come up with some conditional formatting stuff. The aim is to highlight the duplicates across multiple sheets and with in the sheet as well. Assumptions:- 1. I am assuming that sheet names goes on like sheet1, sheet2, sheet3.... 2. The Target Column No. is same in all the sheets. I mean, as in the attached example, its Column A which is being targeted in both sheets.

Automation:- Sending Invitation to Meeting Using Excel VBA

Hello Everyone, In one of the previous post, I wrote about automating Sending Emails using Excel VBA. This time I have come up with a pretty similar code. The code below sends Outlook Meeting Invitations to recipients on one click. here is the Code:- Sub Send_Invite_Auto() Dim olApp As Outlook.Application Dim olApt As AppointmentItem Set olApp = New Outlook.Application 'Creating Outlook Session Set olApt = olApp.CreateItem(olAppointmentItem) 'Creating an Appointment With olApt .Subject = "Enter the subject here." 'Subject .Start = DateAdd("d", 5, Now) 'Enter Date + Time here. .Recipients.Add ("example@gmail.com") 'Recipient Name, Alias, or any other Attribute. .MeetingStatus = olMeeting 'olAppointmentItem with Meeting status olMeeting 'becom

Making Password Protected PDFs using Excel Vba and PDFtk Tool

Hi Everyone, This time, I have come up a VBA Code to generate Password protected PDFs using Excel. Actually, Excel Vba has .ExportAsFixedFormat Method to generate PDFs but this hasn't any Parameter which takes password to protect the PDFs. So I have used PDFtk Tool which provide Command Line Interface to make PDFs protected using Password. Actually, You can do various things using PDFtk Tool command line varying from creating, merging, Protecting and many other. So Download the PDFtk Tool from the following link:- Download PDFtk Tookit Here are the Steps:- 1. Install the PDFtk Toolkit. 2. Use the following code to Print or Export the Activesheet with a password.