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

2 views (last 30 days)
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!

Accepted Answer

Jeremie Lagarde
Jeremie Lagarde on 22 Apr 2019
Edited: Jeremie Lagarde on 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

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!