Is there a way to load data from an Excell file making sure that this is Saved?
Show older comments
In one of my projects, I am constantly editing input data for a Matlab program in an .xlsx file. Each time I run the Matlab program, this reads the specifie column of the .xlsx file and continues running the program. However, if I forget clicking save in the Excell file before running the Matlab, the changed values are not loaded into Matlab Workspace.
Thus, my question is if there is a way to make sure .xlsx file is saved before reading the data from it.
Hope I explained myself properly.
Thank you very much in advance.
3 Comments
Walter Roberson
on 2 Feb 2021
Windows with Excel installed? If so then maybe you could use ActiveX to command that the data be saved.
Aurea94
on 2 Feb 2021
Aurea94
on 2 Feb 2021
Answers (1)
Jan
on 2 Feb 2021
0 votes
This means, that you use Excel as GUI of Matlab. This is a bold approach. What about proramming the GUI in Matlab directly?
Use "Save" instead of the "Saveas"
6 Comments
Aurea94
on 2 Feb 2021
Aurea94
on 2 Feb 2021
Jan
on 2 Feb 2021
I tried some methods also. Whenever I've edited an Excel file, which was opened by Matlab, I cannot access the methods anymore due to the error: "Error: Call was rejected by callee."
What about importing the data and displaying them in a uitable object? There you do not need the complex interaction between Excel and Matlab.
Aurea94
on 4 Feb 2021
Jan
on 4 Feb 2021
See:
doc readtable
doc uitable
Aurea94
on 5 Feb 2021
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
