Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ReSaving a file, keeping its original name.

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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

789 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