MATLAB: Do I get error “The specified file could not be found” for the deployed application that uses “actxserver”

activexfilefoundMATLAB Compilernotpowerpoint

I am currently deploying an application I created in MATLAB.
The problem which occurs here is while generating an activeX presentation with the following lines :
ppt = actxserver('PowerPoint.Application');
ppt.Visible = 1;
pTemplate = 'Template.pptx';
Presentation = ppt.Presentation.Open(pTemplate)
When the app is deployed it returns me an error :
Error using Interface.91493462_5A91_11CF_8700_00AA0060263B/Open
Invoke Error, Dispatch Exception: Le fichier spécifié est introuvable.
(The specified file could not be found)
I do not see this error when running the application from within MATLAB. Furthermore, this error continues even if the file is included as a dependency when I compile it.
How can I make sure my compiled application finds this file?

Best Answer

This application is able to run from within MATLAB because 'Template.pptx' was on the file path.
In order to use this file in a deployed application, the full path must be specified in the argument to "ppt.Presentation.Open".