How do I link excel to an existing MATLAB session when using Spreadsheet Link?
5 views (last 30 days)
Show older comments
MathWorks Support Team
on 17 Sep 2021
Edited: MathWorks Support Team
on 23 Jun 2023
Currently I have a MATLAB session opened with data in the worksapce and I am trying to export that data into excel. To do this, I open excel, and then a new MATLAB session is opened along with it and they are connected. Then I use the "save" command to save the data into a file and then import the file into the newly opened MATLAB session, and then export that data into excel.
I would like to know how to skip the new MATLAB session in the middle, so I could export the data in the current MATLAB session directly into a newly opened excel.
Accepted Answer
MathWorks Support Team
on 12 Jun 2023
Edited: MathWorks Support Team
on 23 Jun 2023
To have excel linked to an existing MATLAB session when using Spreadsheet Link, you need to start MATLAB with the automation flag. To do this you can open MATLAB with the command below in the command prompt:
matlab /automation /desktop
This will start MATLAB as an automation instance and display the desktop. After that if you start Excel, it should be automatically connected to this MATLAB session.
Another workaround would be writing data to Excel using ActiveX, please refer to the link below:
0 Comments
More Answers (0)
See Also
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!