I'm trying to convert an Excel file to CSV and this is the code I have so far:
Sub ConvertToCSV(ByVal strFileName As String, ByVal strNewFileName As String)
Dim objExcel, objExcel_Sheet As Object
Set objExcel = CreateObject("Excel.application"
objExcel.Workbooks.Open FileName:=strFileName
Set objExcel_Sheet = objExcel.ActiveSheet
objExcel.SaveAs FileName:=strNewFileName, FileFormat:=xlCSV, CreateBackup:=False
objExcel.Close True
objExcel.Quit
End Sub
I keep getting the following error though:
"Object doesn't support this property or method."
Can anyone help?
Thanks!
Kelly
Sub ConvertToCSV(ByVal strFileName As String, ByVal strNewFileName As String)
Dim objExcel, objExcel_Sheet As Object
Set objExcel = CreateObject("Excel.application"
objExcel.Workbooks.Open FileName:=strFileName
Set objExcel_Sheet = objExcel.ActiveSheet
objExcel.SaveAs FileName:=strNewFileName, FileFormat:=xlCSV, CreateBackup:=False
objExcel.Close True
objExcel.Quit
End Sub
I keep getting the following error though:
"Object doesn't support this property or method."
Can anyone help?
Thanks!
Kelly