简体   繁体   中英

Any events supported in ExcelDna?

我想在Excel上初始化几个变量Dna .dll在Excel中加载?

Excel-DNA will check whether your add has a public class that implements the interface ExcelDna.Integration.IExcelAddIn , and if so will run the AutoOpen method when the add-in is loaded, and the AutoClose method if the user removes the add-in from the add-ins list.

So you'd have something like:

public class MyAddIn : IExcelAddIn
{
    public void AutoOpen()
    {
        // Do your initialization here...
    }

    public void AutoClose()
    {
    }
}

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