Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Macro - Saving file auto select YES to file already exists?

Posted on 2014-03-27
2
Medium Priority
?
1,417 Views
Last Modified: 2014-03-27
The following macro will take everything in one Excel file, convert it to CSV format and put it into another Excel file for an AutoCad function we need but we want to code it so it will just choose the two YES prompts that come up for Windows asking if we want to replace and overwrite.

Any assistance offered would be greatly appreciated.
Sub write_csv_xls()
'
' write_csv_xls Macro
' Writes the CSV file then Saves the XLSM file
'

'
    ActiveWorkbook.SaveAs Filename:= _
        "F:\Cadd\Blocks\New Titleblock\Title_Frame_Register.csv", FileFormat:=xlCSV, _
        CreateBackup:=False
    ActiveWorkbook.SaveAs Filename:= _
        "F:\Cadd\Blocks\New Titleblock\Title_Frame_Register.xlsm", FileFormat:= _
        xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
0
Comment
Question by:regsamp
[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 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 total points
ID: 39959689
Try framing your code with

application.displayalerts=false

'your code

application.displayalerts=true

Open in new window


This should disable the warnings while you save, assuming you're running this macro from within excel and not in a vb script batch.

Thomas
0
 

Author Comment

by:regsamp
ID: 39959720
It is an Excel Macro. Okay, I will try it. Thank you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Make the most of your online learning experience.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Progress
Suggested Courses

636 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