[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

File save as - replace existing file

Posted on 2008-06-12
3
Medium Priority
?
856 Views
Last Modified: 2010-04-21
I my existing macro I have to save the active worksheet as a csv.  The csv will always exist in the directory which I am saving it to.  Is there a parameter in the saveas command that will automatically answer the replace file question?
ActiveWorkbook.SaveAs Filename:="C:\my documents\Costing.csv", FileFormat:=xlCSV, CreateBackup:=False

Open in new window

0
Comment
Question by:ilrosebud26
[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
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 200 total points
ID: 21772865
Hi rosebud,

If you toggle DisplayAlerts before and after the saveas line, it shouldn't prompt you.

Matt
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\my documents\Costing.csv", FileFormat:=xlCSV, CreateBackup:=False
Application.DisplayAlerts = True

Open in new window

0
 

Author Closing Comment

by:ilrosebud26
ID: 31466709
Thank you for your quick response.  I am sorry to ask something so simple but now I know!
0
 
LVL 35

Expert Comment

by:mvidas
ID: 21773042
Not a problem! It is a useful thing to use remove any prompt you get (saveas, erase sheet, etc). Almost as useful as turning off ScreenUpdating to make things run smoother :) Let me know if you need anything else
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 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