MATLAB Answers

rewriting .xlsx template to new file

11 views (last 30 days)
Christelle Rodier
Christelle Rodier on 9 Dec 2020
Edited: Théophane Dimier on 9 Dec 2020
Hello everyone,
I prepared a template (.xlsx-file), which I want to use and fill with information.
-> But I'd like the template to be unchanged and a new file with the information of the template + the new information created in my script.
-> Maybe in additon to that, is it possible that a window opens which allows the user to give this file a dedicated name?
Many many thanks in advance for your support on this!
Best regards!

  0 Comments

Sign in to comment.

Answers (1)

Théophane Dimier
Théophane Dimier on 9 Dec 2020
Edited: Théophane Dimier on 9 Dec 2020
Hello!
If you want to keep the formatting unchanged, consider using an actxserver (see here) onto Excel. Then you can access all the functions of Microsoft to modify your file.
See a demo there.
To have the complete list of available functions accessible: Microsoft documentation. A good solution for you would be to open your template, save it under the new name and then modify it (all the steps are in the demo).
Concerning your second question: uiputfile should be a good solution (see here).
Best !

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!