Caught "std::exception" Exception message is: createInputStream failed:
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
I'm working on a program in MATLAB 2019b to analyze test data and automatically generate a PowerPoint report of the results using mlreportgen.ppt. The code is set up to use a template to create the presentation and replace various uniquely named picture placeholders with the figures it generates. I unfortunately can't post my exact code, but here is a recreation of the relevant portions:
import mlreportgen.ppt.*
template = 'myTemplate.pptx';
newSlides = 'finalReport.pptx';
slides = Presentation(newSlides,template);
%code to generate plot
saveas(gcf, 'Fig1.png');
replace(slides,'Picture Placeholder Name', Picture('Fig1.png'));
close(slides);
The error is occurring at close(slides), and gives the following error message:
Caught "std::exception" Exception message is:
createInputStream failed:
In addition to replacing figures, the code is also set up to replace to replace titles and various textboxes in the PowerPoint. When you run the code without the commands to replace the pictures (leaving commands to replace text), it works fine, and when I give the close(slides) command, it generates a PowerPoint with the replaced text and all of the slides from the template. The error only occurs when I try to replace the picture placeholders with figures. When I inlude those commands, the resulting PowerPoint still has the replaced text, but all of the slides after the first slide I attempt to replace a picture on are deleted. I wasn't able to find any info on the exact error, but a similar error recommended using fclose('all') to solve it. I've tried including that command before close(slides), and it didn't help.
Have any of you encountered this error before? Thank you in advance for your help!
3 Kommentare
Andreas
am 10 Feb. 2023
Hello Stephanie Farney, could you please elaborate with an example. I am running into almost the exact issue you have and need some further insight.
Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!