Can't open powerpoint file using mlreportge​n.ppt.Pres​entation Class

조회 수: 13 (최근 30일)
Chris Nemecek
Chris Nemecek 2024년 9월 24일
댓글: Chris Nemecek 2024년 9월 25일
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.

답변 (1개)

Kanishk
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
  댓글 수: 1
Chris Nemecek
Chris Nemecek 2024년 9월 25일
It does seem to be a permissions issue potentially with test.pptx. The directory is on a linux network share that is accesible on WIndows. I am running the code from Matlab on Windows. I tried chmod 777 test.pptx on linux and re-running the code on Windows, but that didn't resolve the issue either. I tried allowing all permissions on test.pptx on the Windows side through Properties, but that didn't resolve the issue either.
I moved all files to my local C: drive and everything worked as expected.
There must be some unique permission setup for network share.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by