Hello,
Is there a way to Modify a Excel Table in a PowerPoint Presentation with Aspose ?
Any Examples ?
Thank You ,
Marius W.
Hi Marius W,
Thanks for inquiring Aspose.Slides.
I have observe the requirement shared by you and like to share that you can edit the chart data using Aspose.Slides and Aspose.Cells for modifying the Ole frame data added in PowerPoint presentation. Please visit this documentation link for your kind reference. Please share, if I may help you further in this regard.
Many Thanks,
Hello,
Thanks a lot !!
It work , but the modified excel data not save in the Pptx File…
So , i think this Code work not really ?
/// CODE ///
Wb.Save(msout, so1);
//Changing Ole frame object data
msout.Position = 0;
ole.ObjectData = msout.ToArray();
pres.Write(“Test.pptx”);
//////////////
But when i save the modified Workbook in Xlsx it work.
Thank You,
Marius W.
Hi Marius W,
I have observed the issue shared by you. Can you please share the sample source presentation, generated presentation, excel file and sample application that you are using on your end to reproduce the issue. I will investigate the issue further on my end to help you out.
Many Thanks,
Hello,
i hope you can help me.
///Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Slides;
using Aspose.Cells;
using Aspose.Slides.Pptx;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// args[0] - Powerpoint File
//Load Template
if (args.Length == 0)
{
Console.WriteLine(“No Arguments”);
}
else
{
PresentationEx pres = new PresentationEx(args[0]);
SlideEx slide = pres.Slides[0];
OleObjectFrameEx ole = null;
//Traversing all shapes for Ole frame
foreach (ShapeEx shape in slide.Shapes)
{
if (shape is OleObjectFrameEx)
{
ole = (OleObjectFrameEx)shape;
}
}
if (ole != null)
{
//Reading object data in Workbook
Workbook Wb;
System.IO.MemoryStream msln = new System.IO.MemoryStream(ole.ObjectData);
Wb = new Workbook(msln);
System.IO.MemoryStream msout = new System.IO.MemoryStream();
//Modifying the workbook data
Wb.Worksheets[1].Cells[“P2”].PutValue(“10”);
Aspose.Cells.OoxmlSaveOptions so1 = new Aspose.Cells.OoxmlSaveOptions(Aspose.Cells.SaveFormat.Xlsx);
Wb.Save(msout, so1);
//Changing Ole frame object data
msout.Position = 0;
ole.ObjectData = msout.ToArray();
pres.Write(“New_Trendmonitor_Spiegel.pptx”);
}
}
}
}
}
///
Thank You,
Marius W.
Hi Marius W,
I have worked with the sample code and sample presentation file shared by you and have not been able to observe the issue while using Aspose.Slides for .NET 7.8.0. I have generated the presentation file with your code and I am also able to edit Ole frame data using PowerPoint as well. For your kind reference, I have attached the generated presentation as well. Please try using the latest version of Aspose.Slides and Aspose.Cells on your end.
Many Thanks,