modify autosave macro

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
Hi all

Below Marco does almost everything I need but !!
Can anyone advsie if its possible to change it slightly so that the orignal file will remain open and that the auto saved file will save in the background

Eg, Im using it on a file called Planning.xlsm which is located on the server

but after the below macro runs the file displayed to the user is ''backups-2015-0529-1208.xlsm'' instead of remaining with the original on the server








HTML:
Private Sub Workbook_BeforeClose(Cancel As Boolean) 
    Application.OnTime dTime, "MyMacro", , False 
End Sub 
 
Private Sub Workbook_Open() 
    dTime = Now + TimeValue("00:00:05") 
    Application.OnTime dTime, "MyMacro" 
End Sub 
 
 
Public dTime As Date 
Sub MyMacro() 
    dTime = Now + TimeValue("00:15:00") 
    Application.OnTime dTime, "MyMacro" 
     
    ActiveWorkbook.SaveAs Filename:="c:\whatever" & Format(Now, "-yyyy-mmdd-hhmm") & ".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False 
     
     
End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Instead of
ActiveWorkbook.SaveAs Filename:="c:\whatever" & Format(Now, "-yyyy-mmdd-hhmm") & ".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False

Use

ActiveWorkbook.SaveCopyAs Filename:="c:\whatever" & Format(Now, "-yyyy-mmdd-hhmm") & ".xls"

should do what you want...
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,438
Members
448,897
Latest member
dukenia71

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top