Solved

ReSaving a file, keeping its original name.

Posted on 2014-11-10
3
122 Views
Last Modified: 2014-11-10
Why would this fail?  I am trying to resave a file back to the same name that I opened it?
Am I missing something?  All I am looking to do is over write the original.    Please advise


    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:="\\na\Global-Groups\Holland\Operations\Logistics\DSC\Go to Work Signals\RePlan Report\NewReplanReportTemplate.xlsm", _
        FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

Open in new window

0
Comment
Question by:RWayneH
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 300 total points
ID: 40433007
Because you have already got it open, the computer thinks that you are trying to save a new file, so it tries to delete the old file as part of the saving process, but you've already got it open, so it can't.

Why not use ActiveWorkbook.Save instead?
0
 
LVL 10

Assisted Solution

by:JEaston
JEaston earned 200 total points
ID: 40433008
It has been a while since I used VBA in Excel.  However, I think SaveAs would attempt to overwrite the file, but it sound like you already have the file open.

To save the file you currently have open you should only need
ActiveWorkbook.Save

Open in new window

0
 

Author Closing Comment

by:RWayneH
ID: 40433754
Phillip beat you by a few second so I gave him some extra pts.    Thanks for the help
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question