Solved

ReSaving a file, keeping its original name.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

24 Experts available now in Live!

Get 1:1 Help Now