How can I import data from a Text Box in an Excel Spreadsheet into Matlab?

2 Ansichten (letzte 30 Tage)
I have used an excel template to create many instances of an excel spreadsheet which contains data in a text box. How can I import this data into Matlab? For example, how would I import "Hello World!" in this illustration? I have tried using xlsread to no avail.
HelloWorld.png
Thanks!

Akzeptierte Antwort

Jeremie Lagarde
Jeremie Lagarde am 22 Apr. 2019
Bearbeitet: Jeremie Lagarde am 22 Apr. 2019
Following Walter Roberson's suggestion, I wrote a function which uses actxserver to solve this problem:
function myText=getTextFromExcelTextBox(filename,sheetname,textboxnmbr)
exl=actxserver('excel.application');
exlWkbk=exl.Workbooks;
exlFile=exlWkbk.Open(filename);
myExlSheet = exlFile.Sheets.Item(sheetname);
myText=myExlSheet.Shapes.Item(textboxnmbr).TextFrame.Characters.Text;
end

Weitere Antworten (0)

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by