简体   繁体   中英

How to add handlers to Excel Calculate Events with ExcelDNA

I would like to be able to listen to the BeginCalculate and EndCalculate events for all sheets in Excel from my ExcelDNA addin, and execute some intialization code. Is there a way to do this?

There was some discussion on the Excel-DNA Google group here: https://groups.google.com/group/exceldna/browse_frm/thread/58da470968d6658b This shows how to handle the C API ON.RECALC event, which fires after a recalculation.

You can get also hold of the Excel Application COM object with a call to ExcelDnaUtil.Application , and then register your event handlers for the Application events. The Application events are documented here: http://msdn.microsoft.com/en-us/library/office/jj734018.aspx and you might be interested in AfterCalculate .

I don't know of any Excel events that fire before recalculation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM