'Then use the auto open event to set a reference to this variable, from which it can be used through the project. Like this: Class StartUp Implements IExcelAddIn Public Sub Start() Implements IExcelAddIn.AutoOpen Application = ExcelDna.Integration.ExcelDnaUtil.Application End Sub Public Sub Close() Implements IExcelAddIn.AutoClose 'Fires when addin is removed from the addins list but not when excel closes ' - this is to avoid issues caused by the Excel option to cancel out of the close after the event has fired. MsgBox("Bye bye, from my DNA addin") End Sub End Class
'Then use the auto open event to set a reference to this variable, from which it can be used through the project. Like this: Class StartUp Implements IExcelAddIn Public Sub Start() Implements IExcelAddIn.AutoOpen Application = ExcelDna.Integration.ExcelDnaUtil.Application End Sub Public Sub Close() Implements IExcelAddIn.AutoClose 'Fires when addin is removed from the addins list but not when excel closes ' - this is to avoid issues caused by the Excel option to cancel out of the close after the event has fired. MsgBox("Bye bye, from my DNA addin") End Sub End Class
Practice%20project%20converting%20XLAM%20to%20ExcelDna.docx