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

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, _
    ActiveWorkbook.SaveAs Filename:= _
        "F:\Cadd\Blocks\New Titleblock\Title_Frame_Register.xlsm", FileFormat:= _
        xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Who is Participating?
nutschConnect With a Mentor Commented:
Try framing your code with


'your code


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.

regsampAuthor Commented:
It is an Excel Macro. Okay, I will try it. Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.