Can't open powerpoint file using mlreportgen.ppt.Presentation Class
14 次查看(过去 30 天)
显示 更早的评论
Everytime I try to open a .pptx file using mlreportgen.ppt.Presentation I get an error.
import mlreportgen.ppt.*
pptObj = Presentation('test.pptx','template.pptx')
pptObj =
Presentation with properties:
TemplatePath: 'template.pptx'
OutputPath: '\\ad\empiredfs\data\aero1\Users\nemecect\Tools\matlab\src\file\exportToPowerPoint\test.pptx'
Children: []
Parent: []
Tag: 'ppt.Presentation:27'
Id: '27'
open(pptObj)
Error using mlreportgen.ppt.Presentation/open
Cannot open file. //ad/empiredfs/data/aero1/Users/nemecect/Tools/matlab/src/file/exportToPowerPoint/test.pptx
I get the error if test.pptx has already been created and I'm trying to add to the file. After the error, test.pptx goes from its original file size to 0 KB, so it effectively deletes/erases the file.
Also, I get the error if test.pptx has not been created and I'm trying to create a new file from the template. After the error, test.pptx is created with a file size of 0 KB.
How can I debug this or make this work? The error is very unhelpful. The file definitely exists. It is not open in Powerpoint and is not locked.
0 个评论
回答(1 个)
Kanishk
2024-9-25
Hi Chris,
I understand you are facing an error while generating a PowerPoint presentation using MATLAB report generator.
I tried the workflow you mentioned and created a “template.pptx” file. I was not able to reproduce the error. I faced a similar error after removing the “template.pptx” file. Make sure the path to template file is correct.
Also, make sure you have permission to write in your current folder. I was able to reproduce the exact error after removing write permissions for the current directory.
To learn more about MATLAB report generator, please go through this official MATLAB documentation.
Thanks
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!