https://autohotkey.com/board/topic/5698 ... ntry381256
first, when I try to change the data and read it back, it work but when I open the excel file normally the data didn't change.
so I try to save the file using this code.
Code: Select all
FilePath := "G:\AutohotkeyScript\testexcel.xlsx" ; example path
oExcel := ComObjGet(FilePath) ; access Workbook object
;oExcel.Visible := True ; make Excel Application visible
MsgBox % oExcel.Sheets(1).Range("A1").Value ; get value from A1 cell in first sheet
oExcel.Sheets(1).Range("A1").Value := 3 ; change value in A1 cell
MsgBox % oExcel.Sheets(1).Range("A1").Value ; readback the value from A1 cell in first sheet
oExcel.Save()
but I cannot open the file normally anymore, it became some kind of a blank file.
how can I fix this?
ps.I try to make it Visible(the commented line) but I get compile error: 0x80020006 - Unknow name.