I need to create a scatter chart in a new tab, referencing series in the 1st worksheet but I continue to get an error when creating the new worksheet. Following examples I found in another thread on this forum (https://forum.aspose.com/t/115170) I'm trying to get below to work but I get Object reference not set to an instance of an object. It is failing on the Worksheets.Add(SheetType.Chart); line
datatable dt;
m_oDT = dt;
Workbook m_oWBIMSRpt = new Workbook();
Worksheet m_oIMSDataSheet = m_oWBIMSRpt.Worksheets[0];
m_oIMSDataSheet.Cells.ImportDataTable(m_oDT, true, "A1");
m_oWBIMSRpt.Worksheets.Add(SheetType.Chart);
Charts m_oIMSChartSheet = m_oWBIMSRpt.Worksheets[1].Charts;
Below works but does not suite my need. I need the sheet to be of the type chart for later processing:
m_oWBIMSRpt.Worksheets.Add(SheetType.Worksheet);
Worksheet m_oIMSChartSheet = m_oWBIMSRpt.Worksheets[1];
Thanks in advance.