Macro to Save As Backup File or Create a Pop Up to save File

kdsanderson30

New Member
Joined
Jun 12, 2014
Messages
17
I am not GREAT at Macros, so I will try and explain what I need the best I can.

We have a workbook that has a macro already with a Live Clock that calculates the job times etc. It is on a Server for remote access and used by many people 1 at a time. I look in the file at the data to send intervention emails regarding the times etc. The problem, is that the user does not SAVE the file but every couple of hours so I am not seeing live data. We cannot force a save without a pop up of sometimes, which would be the best bet, but I am unsure how to do that.

Another option is to Autosave a backup file every so many minutes that I could view remotely and use to send the intervention emails without disturbing their copy. Any ideas?
 

hippiehacker

Well-known Member
Joined
Aug 2, 2011
Messages
1,911
place in a normal module this code

Code:
Public dTime As Date
 
Sub AutoSaveAs()
    dTime = Time + TimeValue("00:05:00")
    With Application
        .OnTime dTime, "AutoSaveAs"
        .EnableEvents = False
        .DisplayAlerts = False
        ThisWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\Backup " & ActiveWorkbook.Name
        .EnableEvents = True
    End With
End Sub
and in ThisWorkbook Module this code

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.OnTime dTime, "AutoSaveAs", , False
End Sub
 
Private Sub Workbook_Open()
    dTime = Time + TimeValue("00:05:00")
    Application.OnTime dTime, "AutoSaveAs"
End Sub
it will save a backup file (every 5 mins) of your original at the same place only with Backup in front of the filename
 

kdsanderson30

New Member
Joined
Jun 12, 2014
Messages
17
Thank you for your reply!

I tried he codes above and got this "Compile error: Ambiguous name detected: ~ "
 

Forum statistics

Threads
1,081,702
Messages
5,360,743
Members
400,595
Latest member
T_Dubs

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top