Adding media Object to PowerPoint from Matlab

I'm getting an error when trying to add a video to PPT from Matlab. This code was given to me by a coworker and it works on his machine. We are both using R2017a, but I am using Windows 10 and he is using Windows 7. I am using PPT version 1908 and he is using version 1808.
The code I'm trying to run looks like this:
Title1 = Slide.Shapes.AddMediaObject2(VideoFile, position(1) , position(2), position(3) , position(4));
Title1.Left = position(1);
Title1.Top = position(2);
Title1.Width = position(3);
Title1.Height = position(4);
I'm getting the following error when running the code:
Error using Interface.91493475_5A91_11CF_8700_00AA0060263B/AddMediaObject2
Error: The remote procedure call failed.
Error in addVideo2PPT (line 79)
Title1 = Slide.Shapes.AddMediaObject2(VideoFile, position(1) , position(2), position(3) , position(4));

댓글 수: 1

I found the issue. It was trying to add an AVI file to the PPT. The problem is another script was placing a space between the filename and the .avi file extension when the video file was created. Eliminating the space makes the script work.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

질문:

2020년 5월 15일

댓글:

2020년 5월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by