Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Microsoft.Office.Tools.ListObjectAdapter - System.NullReferenceException
Hi there,
I am a developer that works with a legacy Excel Extension codebase. Now we are populating a few tables using Microsoft.Office.Tools.Excel. Currently I am experiencing a System.NullReferenceException in Microsoft.Office.Tools.Excel.ListObjectAdapter (as shown in the picture below).
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;
}
Troubleshooting methods used:
A colleague of mine suggested to check if I am correctly logged into a Visual Studio and Excel (I am). Since the problem seems to be inside a official library I have tried to read documentation with no success so far.
Any help is appreciated.
Microsoft 365 and Office | Development | Other
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.