I am new to develop VSTO add-in. Following the second VSTO code example of the walkthrough How to: Programmatically list all worksheets in a workbook, the VSTO add-in is no problem in Excel 2021 but throwing an Exception System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800A03EC'
in Excel 2013 at line Excel.Range rng = this.Application.get_Range("A1");
.
I installed both 2013 and 2021 versions on Windows11 and I use VS2021 to develop. Thanks for answers.