Auto save vba opening new file instead of just saving

Matt Young

New Member
Joined
Nov 2, 2018
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi I know this tittle makes little sense but here goes

so I ave a few macros that clear the many sheets have for new data entry. What I want to do is to have the macro auto save with a new name in another location.
I can get it all working but the after the auto save, the new save is opened and the original is closed.
Her is the "auto save vba"

Sub AutoSave()
'
' AutoSave Macro
'

'
ChDir "C:\Users\e368464\Desktop\backup spreadsheet\AutoSave"
ActiveWorkbook.SaveAs Filename:="C:\Users\e368464\Desktop\backup spreadsheet\AutoSave\SF025 - v3.3 - Device Backup Spreadsheet" & Format(Date, "yyyymmddhhmmss") & "xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

Afte the save the macro works perfectly, however, the wrong fle is open (the suto save file which I am using as the backup).
Can any one shed any ligt on what I am doing wrong plese?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You aren't doing anything wrong as such. It is just how Excel works.

In order to keep open the original you will need to store its path and name then re-open once you've done the SaveAs
 
Upvote 0
You aren't doing anything wrong as such. It is just how Excel works.

In order to keep open the original you will need to store its path and name then re-open once you've done the SaveAs

Ohhh Ok. Would "SaveCopyAs" work do you think?
 
Upvote 0
Yes, that would work just remember to use the fully qualified path and file name.

My Apologies, I should have suggested this earlier.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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