eastern314 0 Posted August 30, 2011 hello ,guys. I hava a problem here: When I use _ExcelBookSaveAs($oExcel_1, @DesktopDir &"\1.csv","csv", 0,1) to save csv file ,it is not working. somebody says that the excel udf should be updated. For example, we cant not save txt file using _ExcelBookSaveAs($oExcel_1, @DesktopDir &"\1.txt","txt", 0,1). However ,when we modify "if $sType = "txt" Then $sType = $xlTextWindows" to "if $sType = "txt" Then $sType =-4158" in the excel.au3, it is working. The problem is that I cannot find the $stype number that used for csv, can anybody give some help? many thanks in advance! Share this post Link to post Share on other sites
JoHanatCent 13 Posted August 30, 2011 hello ,guys. I hava a problem here: When I use _ExcelBookSaveAs($oExcel_1, @DesktopDir &"\1.csv","csv", 0,1) to save csv file ,it is not working. somebody says that the excel udf should be updated. For example, we cant not save txt file using _ExcelBookSaveAs($oExcel_1, @DesktopDir &"\1.txt","txt", 0,1). However ,when we modify "if $sType = "txt" Then $sType = $xlTextWindows" to "if $sType = "txt" Then $sType =-4158" in the excel.au3, it is working. The problem is that I cannot find the $stype number that used for csv, can anybody give some help? many thanks in advance! This is working for me: #include <excel.au3> $oExcel = _ExcelBookOpen(@DesktopDir & "\Test.xls", 0) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Shame on you!") Exit EndIf _ExcelBookSaveAs($oExcel, @DesktopDir & "\1.csv", "csv", 0, 1) _ExcelBookSaveAs($oExcel, @DesktopDir & "\1.txt", "txt", 0, 1) Did you make sure you have no errors when opening your workbook? SBTW: ( $sType = ) Normal = xls = -4143 CSV = 24 TXT = 20 Share this post Link to post Share on other sites