.NET
Microsoft Technologies based on the .NET software framework.
3,919 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am working with a legacy Excel Extension codebase where we are populating tables using Microsoft.Office.Tools.Excel. I am encountering a System.NullReferenceException in Microsoft.Office.Tools.Excel.ListObjectAdapter as shown in the picture below:
I have included relevant code below, but I have not been able to solve the issue. I have already checked to ensure that I am correctly logged into Visual Studio and Excel. I have also tried reading documentation without success.
private readonly ApplicationFactory factory;
private async Task ProcessSetting(WorkBookListOFvalues item, Stopwatch s, long time, StringBuilder print)
{
ListObject tableLo = null;
DataSet ds = null;
DataTable data = null;
try
{
try
{
globals.Dispatcher.Invoke(() =>
{
tableLo = factory.GetVstoObject(ExcelExtensions.GetListObject(TargettyFormLoadAndSave.Action.applicationSettings.Workbook, item.ListObject));
});
}
catch (Exception e)
{
// Error handling
return;
}
Any help is appreciated.