I need to control excel's behavior when I use excel doing some task. I run this script:
#lang racket
(require ffi/com)
(define app (com-create-instance "Excel.Application"))
(define wbs (com-get-property app "Workbooks"))
(define book (com-invoke wbs "Open" file-path 0))
(com-set-property! app "ScreenUpdating" #t)
(com-set-property! app "EnableEvents" #t)
(com-set-property! app "Visible" #t)
(define ex (com-make-event-executor))
(define thd-save (thread (lambda () (let loop () ((sync ex)) (loop)))))
(com-register-event-callback book "AfterSave"
(λ (Success) (Workbook_AfterSave Success))
ex)
However, this script throws an error: advice: failed (8002000b; invalid index). In Racket's documentation, it states that registering COM events depends on the myssink.dll component. Could this component be incompatible with the operating system or Office components? I am using Windows 10 Enterprise LTSC and Office 2016.