MATLAB standalone application that includes Excel data template

I would like to include an Excel spreadsheet within my standalone application that has a lot of formatting applied and will simply be filled with data and saved to a local drive. If I include it as a 'required file' during compilation, MATLAB opens it when I load the program. Obviously I can prompt the user to select the file or I can save the file in a specific directory, but is there any way to do it by storing the xlsx file as part of the program?

3 Kommentare

Hi, let part by part break down what you are saying
Compile your application together with Excel spreadsheet
In this part, why don't you store your data in mat. file instead. Since user can't see the excel file as it is part of the your executable file.
Obviously I can prompt the user to select the file or I can save the file in a specific directory
If user want to select the file and write to a excel file saving in a sepcific directory, at this moment, you program read the mat.file and then write to excel by either readtable(), xlsread(), or ActiveX. It allows you to save the excel file in whatever directory you want.
but is there any way to do it by storing the xlsx file as part of the program?
Still same, I recommend to save your data in mat file and compile them in mat file.
Thanks for your response. I don't need the user to see the Excel file. The Excel file is just an empty template that I want to fill with data and then save to the users computer. It's just that it has nice formatting so they can just print it with all the data filled in.
For compilation, i'm still prefer save it as mat. file. if user want to print it, at that moment, in your program, you write your data to excel.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 28 Okt. 2018

0 Stimmen

Use the -a option in mcc to include a file in your executable.

7 Kommentare

Hi. Yes, this is what I want, thanks. Where does this file 'go' during installation, though? How do I specify its location in the application's code? When in the app designer, the file can simply reside in my current folder and I can refer to it without specifying the directory, but I've installed the app and I can't find.
Uh, yeah, long story. I don't have time to get into it now. Basically it goes into some hidden secret folder. That's why I don't use deploytool and use a different tool to create my installation package that lets me install/ship files and put them exactly where I want them to go. I was using WiseInstaller but since it's dead now I'm considering Centurion Setup instead - I'm still evaluating it.
Ok, thanks. Is there any documentation detailing all of this?
Great, thanks!
Did this work for you? I want to do the same thing, however, can't get it to work.
Did you use the -a option, change MCR_CACHE_ROOT, or both?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by