View Full Version : File extension issues

06-25-2018, 10:16 AM
Hello all, I am new here and I was wondering if someone may be able to help me. I was tasked with writing a program that would take 6 different CSV files, manipulate the data, combine them into one CSV file and save it. My program is working but my end product is an xlsm file instead of a CSV. I wrote my program in the editor in xlsm format. I tried saving the final file as a CSV after the fact but when I open it up, it says that the file extension and the file type don't match. Is there an easy way to change this file format without external software? Thanks in advance!!

06-25-2018, 10:34 AM
I just created a new workbook, put in some data, and recorded a macro to save the file as a CSV

Option Explicit
Sub Macro1()
' Macro1 Macro
ActiveWorkbook.SaveAs Filename:="C:\Users\USERID\Documents\CSV1-2-3.csv", FileFormat:=xlCSVUTF8, CreateBackup:=False
End Sub

06-26-2018, 07:28 AM
Thank you very much sir, that was very helpful!