how to change Change Excel Format?

Hi How do I use VB to change Excel format from CSV to Excel Workbook with same filename?

I open it using Excel.Application
One way that work is that using SaveAs , and set file format to xlExcel9795, but the problem is that it will prompt a dialog "Do you want to overwrite it? Y/N/C".  I want it to automatic saved without display dialog, if file exist, just overwrite.

Or is there anyway to just change the fileformat of Excel CSV to Excel Workbook and saved.
AStronusAsked:
Who is Participating?
 
Richie_SimonettiIT OperationsCommented:
Use .displayalerts= false before save, save the file and then  reset to true from Excel.Application object.
0
 
Richie_SimonettiIT OperationsCommented:
Other possible way is check if file already exist, delete it and saveas normally.
0
 
Richie_SimonettiIT OperationsCommented:
Thanks for "A" grade.
0
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.