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 comentario

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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Mayo de 2020

Comentada:

el 18 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by