?
Solved

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

Posted on 2014-03-27
2
Medium Priority
?
1,372 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Simple Linear Regression
Suggested Courses

741 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