[v2-a101|a103] ComObjConnect not working

Report problems with documented functionality
User avatar
kczx3
Posts: 858
Joined: 06 Oct 2015, 21:39

[v2-a101|a103] ComObjConnect not working

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
; }

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests