Adding new slides at runtime

Hi Support team,

I have a requirement in which I want to write tabular data to a slide-X. There are cases where the number of rows exceeds a limit and I need to insert new slides right next to current slide-X.

I use a template to create my final output and I loop through the slides of the template ppts using
foreach (SlideEx sld in slds)
{
switch (sld.Name)
{
case “X”://////////similarly other cases.
}
}
But modifying the slds collection at runtime throws InvalidOperationException at the above foreach - as the collection was modified by addition of new slides.

Can you please give an idea how I can approach this scenario.

Best Regards,

Hi Support team,

I have a requirement in which I want to write
tabular data to a slide-X. There are cases where the number of rows
exceeds a limit and I need to insert new slides right next to current slide-X.

I use a template to create my final output and I loop through the slides of the template ppts using
foreach (SlideEx sld in slds)
{
switch (sld.Name)
{
case “X”://////////similarly other cases.
}
}
But
modifying the slds collection at runtime throws
InvalidOperationException at the above foreach - as the collection was
modified by addition of new slides.

Can you please give an idea how I can approach this scenario.

Best Regards,

Hi Varun,

I have observed the sample shared but unfortunately it is not highlighting the complete scenario where by the issue is incurring. Can you please share a working example with us with which you are able to reproduce the issue on your end. I will observe and use that on my end to help you further. For your further reference of how to create new slide in presentation please visit this link. Please visit this documentation link for your convenience to see how to copy a slide from template presentation and inserting that in source presentation instance.

Many Thanks,