[v2-a101|a103] ComObjConnect not working
Posted: 28 Jun 2019, 11:09
ComObjConnect doesn't seem to be working for me with Excel in v2 (both a101 and a103). Uncommenting the MsgBox function allows running in v1 and the script works there.
Code: Select all
#Persistent
OnExit("beforeExit")
oxl := ComObjCreate("Excel.Application")
ComObjConnect(oxl, "oXL_")
oWorkbook := oxl.Workbooks.Add()
oxl.Visible := True
oxl.WindowState := xlMaximized := -4137
return
oXL_NewWorkbook(wb) {
; msgbox(Type(wb))
msgbox("new workbook")
}
beforeExit() {
Global
oxl := ""
}
; uncomment for v1
; msgbox(text) {
; msgbox, % text
; }