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

2 ビュー (過去 30 日間)
Jeremie Lagarde
Jeremie Lagarde 2019 年 4 月 22 日
編集済み: Jeremie Lagarde 2019 年 4 月 22 日
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!
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 4 月 22 日
You would probably have to use actxserver to talk to Excel to request the information.

サインインしてコメントする。

採用された回答

Jeremie Lagarde
Jeremie Lagarde 2019 年 4 月 22 日
編集済み: Jeremie Lagarde 2019 年 4 月 22 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by