?
Solved

ReSaving a file, keeping its original name.

Posted on 2014-11-10
3
Medium Priority
?
127 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
[X]
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
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 1200 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 11

Assisted Solution

by:John Easton
John Easton earned 800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

770 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