We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

15.7 System.NullReferenceException during Presentation.Save at Table

Dear support,

we are currently evaluating for a customer how to add a table to an existing PPTX with Aspose.Slides for .NET 15.7.

The attached presentation is loaded via:
Me.Presentation = New Presentation(lfile)

The table is added via:
Dim ltab As Table = lSlide.Shapes.AddTable(iPlaceholder.X, iPlaceholder.Y, dblCols, dblRows)

The presentation is saved via:
Me.Presentation.Save(lstream, Export.SaveFormat.Pptx)

The following exception is thrown:

6:01:33 PM-297 (8) System.NullReferenceException: Object reference not set to an instance of an object.
4/25/2017 6:01:33 PM-298 (8) at ​ .(Table , ​ , )
at .(IGroupShape , , , )
at .(IBaseSlide , , )
at .(ISlide )
at .( , ISlide , )
at .(IPresentation , ​ , PresentationTypeEx , IPptxOptions )
at Aspose.Slides.Presentation.(Stream , PresentationTypeEx , IPptxOptions )
at Aspose.Slides.Presentation.x(Stream stream, SaveFormat format, ISaveOptions options)
at com.biexcellence.openbi.ExportBase.openbiPPTCreator.save2Stream(Stream istream, openbiExportMassHtmlGroup imasshtml, String iFormat)
at com.biexcellence.openbi.ExportBase.openbiExportCreatorFactory.publish2Response(String& iFileName, Boolean iStoreFile)

We only get this problem with attached presentation. With other presentations, adding the table works fine.

Thanks for your help

Hi Kai,

I have observed your comments. I have tried loading and saving the presentation using Aspose.Slides for .NET 17.3. I have not observed any issue. Can you please try Aspose.Slides for .NET 17.3 on your end. If there is still an issue then please share the complete working sample code with us as in your sample code there is one partial line for adding table with no other relevant information.

Best Regards,