Make Auto Backup File When Opening

Apr 10, 2012

I want to make a macro that will generate a backup copy each time the Excel file is opened. I premade a backup and recorded the following macro, placing it in the sub here:

Code:
Private Sub Workbook_Open()
ChDir "C:Usersmy.selfDesktop"
ActiveWorkbook.SaveAs Filename:= _
"C:Usersmy.selfDesktopDaily Backup.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled,_ CreateBackup:=False
ActiveWorkbook.Close
End Sub

names have been changed to protect the innocent. But now either putting in to repoen the original working excel or manually opening it puts me in an infinite loop of backing up. The probelm seems to be that to make a copy it is making the open workbook the backup. So two part question here:

1. Can I make a copy under the same name automatically when the file is opened while staying in the current one?
Example: open the Excel file "Working Copy", which makes a mirror file called "Backup Copy", but stay in "Working Copy".

2. From what I did manage to do, I notice every time it asks if I want to overwrite. I chose "Yes" when recording the macro but this doesn't seem to get captured. can I make it automatically yes without being asked?

View 3 Replies


ADVERTISEMENT

Macro To Make Backup For A File At Regular Intervals Without Opening It

Dec 19, 2012

Code to save a file C:DesktopFile.xls to a different path say F:New.xls as a backup.

I want this to happen every 1 hour so that if in case my original sheet File.xls is corrupted or deleted, I have a backup data (New.xls) which was last saved.

And also File.xls need not be necessarily open.

View 1 Replies View Related

How To Make Audit Trail When First Change Is Made Right After Opening Excel File

Jul 30, 2012

Pls see below codes, the codes can record down changes made "from" and "to" and put on the "Log" sheet, however it is unable to capture the original values when I first open the file and make the changes.

Also, how can I put the value of "Now" in column B?

Code:
Dim PreviousValue
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value PreviousValue Then

[Code].....

View 9 Replies View Related

Auto-Adjust Screen Resolution When Opening A File

Sep 18, 2007

I have made an excel spreadsheet. The area with data exactly fills my screen.

When I send it to other colleagues, it perfectly fills their screen too. But for some colleagues the data area is either too big for their screen or takes up a small proportion of their screen based on their screen resolution. I would like the area with data to perfectly fill the screen of all people who will access the file.

I am thinking that I would do an automatic event so that I can change the settings upon opening the file. I have Excel VBA programming for Dummies which explains about automatic events but I have no idea what sort of sub procedure to use.

View 2 Replies View Related

Excel 2010 :: How To Make File Auto Save To PDF

Aug 16, 2013

I have workbook I would like to auto save to PDF copy file in different location every time the original file is save maybe some VBA code

View 4 Replies View Related

Excel 2010 :: How To Make File Auto Save To PDF

Aug 16, 2013

I have workbook I would like to auto save to PDF copy file in different location every time the original file is save maybe some VGA code is this possible ???

View 1 Replies View Related

Auto Save Backup Every 15 Minutes

May 22, 2012

I am looking for some code to auto save my workbook into this location every 15 min,

View 1 Replies View Related

Auto-Save Backup Copy Of Spreadsheet On Weekly Basis?

Apr 26, 2013

I have a shared document used by as many as 11 different people. right now I go into a document and save a copy each week in case one of them messes it up.

just curious if that can be done automatically.

View 3 Replies View Related

Macro Do Backup File

Sep 27, 2002

Just thinking is there a macro that would do a backup of the opened file just by clicking an object?

View 9 Replies View Related

Disable Access To Excel Backup File In VBA?

Oct 7, 2011

Is there some sort of vba code that will stop excel from creating a backup copy of the export file from access?

XLApp.ActiveWorkbook.Close SaveChanges:=True

This code saves and closes the workbook, but it then creates a backup copy. I would like to enter some code so it stops making a backup file.

View 2 Replies View Related

Function For Having Last Backup File Date Value In Cell?

Oct 10, 2012

I would like to have a cell that gives the date of the last save made on the file itself. Like, it has been saved on Oct-3rd for te last time, I open it on Oct-10th and see thru that cell that all last changes were made on Oct-3rd.

View 2 Replies View Related

Macro To Create Automatic Backup Of File

Oct 27, 2013

Is it possible to create a macro that automatically saves a backup of the excel document in another desired location?

I have this formula:

Sub backupbutton()
Dim fname
fname = "D:" & Format(Now, "dd mmm yy hh mm") & ".xlsm"
ThisWorkbook.SaveAs Filename:=fname
End Sub

But that just keeps on making multiple copies of the file rather than overwriting the backup in the D: location.

Also, that particular macro requires me to have to click on a button in order for it to work but I would prefer that it happens automatically when the original file is saved.

View 2 Replies View Related

File Backup To Different Folder Location Automatically Whenever Workbook Closed

Feb 10, 2014

1. A workbook is closed

2. In addition to the original workbook being saved, a copy of the workbook with the current date is also saved to the specified location of my choice.

For example

"C:UsersUSER1DesktopBackup Test as of 02-10-14"

3. If a copy of the workbook is already saved with today's date, then overwrite it automatically without prompting the user.

4. All the above happens without any user interaction.

View 8 Replies View Related

Opening A File Without Opening A Workbook

Apr 17, 2007

I have a need to open a file from my companies intranet. My current method was to open said file via the method that the recorder gave me. However, I would like ot be able to open a said file without having to start open another workbook.

This is the path:
[url]

So the command is this:
Workbooks.Open [url]

Links are not actual links

So what I need to know. Is how can I open this file without opening a workbook. I haven't been able to use the VB "Open Statement" to open a file and I don't believe that I've been successfull using the Filesystem object either.

View 9 Replies View Related

Opening The Workbooks In A Folder, One By One, To Make Changes

May 11, 2007

I'd like to create a macro which will

-go to a given folder

-open each of the workbooks in the folder, one at a time

-after opening the first wkbk, go to a specific cell address on the first tab of the wkbk

-paste in some values and formulas

-save the workbook

-open the next workbook, and repeat as above, for all workbooks in the folder

View 9 Replies View Related

Make Workbook Read Only Upon Opening

Dec 12, 2007

way of changing the mode of a workbook to readonly upon opening it.

View 6 Replies View Related

Opening Excel File From List Of File Names Located In Single Sheet?

May 31, 2013

loop and range function to apply in the below code through which I can avoid writing code for all the rows.

I am trying to open excel files located in single folder from files name (along with the path) in single worksheet (Column B and Row 1 to 500).

I have created follwing code which opens the file and then runs a macro in it.

a Sub Test()
Dim strFName As String
strFName = Sheet1.Range("B2").Value

[Code].....

View 4 Replies View Related

VBA Code For Opening File With Variable Version Number In File Name?

Jan 29, 2014

I have a file that I save with a new version number each time I make major changes. The file name currently is: "Telephony Equipment Inventory v26 (Summary).xlsm". The "26" is the variable number. give me the vba code to ensure I open the file with the highest version number?

View 6 Replies View Related

Auto Save During Opening

Nov 17, 2008

I have attached a code that prompt the user for a store # then that number would automatically copy to cell A1 and at the same time it saves the file name as what is copied to A1.

This is a good code but the problem is when the file is closed and re-open, it prompts the user again for a store number and when you select 'Cancel' it replaces the store# already stored in cell A1.

What I am trying to accomplish:

1- When the file is re-opened, it should detect cell A1, if it's empty prompt user for store #, if it's not empty skip the prompt screen.


Private Sub Workbook_Open()
var1 = InputBox("store#")
Range("a1") = var1
var1_filename = var1 & ".xls"
ActiveWorkbook.SaveAs Filename:=var1_filename
End Sub

View 9 Replies View Related

Auto-disable Macros Opening Workooks Via VBA

Aug 1, 2006

I have to open some woorkbooks via VBA disabling macros automatically (the reason of this is very hard to explain, my boss wants it in this way)

Does any parameter exist to add it to the woorkbook.open function? or any trick to do this?

View 3 Replies View Related

Auto Populate Date In Cell Upon Opening Workbook

Jul 23, 2013

I have a workbook template that will have multiple tabs. I would like to have it that when you open this workbook the date populates in A1 for each tab and is static. At that point they can save with another name leaving the template intact so when you open it again (on another day) it will populate with the current date. Is this possible and if so how?

View 7 Replies View Related

Opening Excel Workbook With Embedded Connections Using VBA And Auto Refreshing

Apr 3, 2014

I have an Excel Workbook with Showcase Queries embedded into it.

Upon a manual open, the user is prompted to either refresh data or keep data since last save, the user then has to enter a username and password to allow the query to access the database.

Using the code below to open the workbook, no such prompts are given. Is the code overriding the prompts and automatically refreshing the data without password? [Given nature of data, visual validation of refresh is not possible]

If not, how can we code a data refresh through showcase query with user/pw req's?

[Code] ......

View 1 Replies View Related

Date Function- Open A File, Make An Exact Copy And Save It Under A New File Name

Jun 4, 2009

I'm working on the following
Workbooks.Open Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-" & Ucase(Format(DateAdd("y", 0, Date)), "YYYY-MM-DD")&".XLS"
ChDir "D:CommondataIBMmain"
ActiveWorkbook.SaveAs Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-NAFTA.XLS", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close

Date: 2009-06-03

What I'm trying too do is open a file, make an exact copy and save it under a new file name.

My problem is in the date formula the day is not always the same. In the sample case it's 03 at other times the day will change.

is there a way too get this too work irregardles of what the day might be?

View 9 Replies View Related

Opening A File ...

Sep 18, 2008

I am trying to do something simple but not quite sure how to do it. I am using the GetImportFileName and then selecting information of one sheet from that file and copying to another workbook. I need to know how to then get back to the file I have opened to search the next sheet and so on. The problem I have is with this line.

Workbooks(FileName).Activate

Sub GetImportFileName()
Dim Finfo As String
Dim FilterIndex As Integer
Dim Title As String
Dim FileName As Variant

' Set up list of file filters
Finfo = "All Files (*.*),*.*"

' Display *.* by default
FilterIndex = 5

' Set the dialog box caption
Title = "Select a file to Import"

' Get the Filename
FileName = Application.GetOpenFilename(Finfo, FilterIndex, Title)

' Open the Filename
Workbooks.Open FileName

WPD
End Sub

View 9 Replies View Related

Opening PDF File

Mar 12, 2006

When I press the button , i would like to open PDF file. The path is "\ engineeringABC.pdf"

View 2 Replies View Related

Opening A Powerpoint File

Sep 22, 2008

I have some VBA code that allows the user to open a linked powerpoint presentation from an Excel workbook. It works well but it does not ask the the user to update links so if the Excel book has changed the powerpoint stays the same. I am very new to VBA so I tend to copy things that work but don't always know why! Anyone out there know how to get it to update links automatically or at least ask the user to do so? Here is the code:

View 2 Replies View Related

Opening File With Dated Name Each Day?

Oct 20, 2009

I would like to open a certain file everyday. However each day this file is created and named with the date, for example Production_FixYYYYMMDD.csv, in VBA how do I accomplish this? The alternative I could think of is to create a .bat file to copy that file over to a separate directory and rename it Production_Fix.csv and just use that, but if that batch file fails to run that would cause issues.

View 4 Replies View Related

File In XLSTART Not Opening

Dec 29, 2009

Any idea why a file in my XLSTART folder does not open when I start Excel?

I had a cell in a file (not one of the files in XLSTART folder) that was refered to by thousands of other cells. I clicked on Trace Dependents and Excel then spent the next 10 minutes trying to point to all the cells. I eventually gave up and used the Windows Task Manager to close Excel. Ever since then Excel doesn't open 1 of the 3 files I have in the XLSTART folder.

View 6 Replies View Related

Macro- Opening A File

Aug 19, 2008

I'm looking for a command for a macro, haven't been able to find it thus far. Is it possible to get excel to open a .txt for example, and copy its contents into excel at an activecell?

View 9 Replies View Related

Opening Large File

Feb 4, 2009

I have a 14.3 MB xlsb file that I am trying to open with no success as it just hangs. Anyone have any ideas on how to get the data out of there? I would like to be able to get the data to a pivot and copy the pivot to another file to try and reduce the load on one file. I tried to import to Access but was told I was using a file version before 2007, which is impossible since it is a xlsb file.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved