Solved

ReSaving a file, keeping its original name.

Posted on 2014-11-10
3
111 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
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 the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now