Solved

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

Posted on 2014-03-27
2
1,259 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
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This is an explanation of a simple data model to help parse a JSON feed
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 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