Code: Select all
oExcel := ComObjCreate("Excel.Application") ; create Excel Application object
; oExcel.Workbooks.Add ; create a new workbook (oWorkbook := oExcel.Workbooks.Add)
oExcel.Visible := 0 ; make Excel Application Visible Visible Visible Visible Visible Visible Visible Visible Visible
oExcel.DisplayAlerts := 0
oExcel.AlertBeforeOverwriting := 0
oExcel.ScreenUpdating := 0
MsgBox, OPEN STORES EXCEL FILE
Loop,
{
FileSelectFile, SelectedFile
if (SelectedFile = "")
ExitApp
else
Break
}
xlCSV = 6
CSVFILENAME := "stores.csv"
oExcel.Workbooks.Open(SelectedFile)
oExcel.Visible := True ; set to false if you don't need excel to be seen
oExcel.DisplayAlerts := False ; this is Set to False to suppress prompts and alert messages
oExcel.ActiveWorkbook.SaveAs(A_Desktop . "\" . CSVFILENAME, xlCSV)
oExcel.ActiveWorkbook.Saved := True
oExcel.Quit
While !FileExist(A_Desktop . "\" . CSVFILENAME)
{
Sleep, 1000
}
Sleep, 1000
CSV_Load(A_Desktop . "\" . CSVFILENAME,data, ",")
Sleep, 100
CSV_DeleteRow(data,1)
CSV_DeleteColumn(data,1)
Sleep, 100
CSV_Save(A_Desktop . "\" CSVFILENAME,data, OverWrite="1")
ExitApp
Is there an even faster method than looping row by row? My file has over 20,000 rows. I switched to CSV because Excel takes ages to load.