Excel's named range through Matlab

조회 수: 11 (최근 30일)
GSM
GSM 2012년 2월 1일
댓글: Aitor Vitoria 2016년 5월 16일
Hello,
I have an Excel file which uses excel named range (I've gave the named range prior to using Matlab). I use xlsread(file,sheet,'RangeName',mode,customFun) to read the named range which is called - 'RangeName'. Now I would like to create Excel file through Matlab using xlswrite, then to write values to several cells and give them name, meaning give those cells a named range. How do I do that through Matlab?
Thank you!
  댓글 수: 2
Braden
Braden 2014년 1월 8일
I have the same question. I cannot find anything in the help menu. Any help would be much appreciated.
Image Analyst
Image Analyst 2014년 1월 9일
What about the help Friedrich gave?

댓글을 달려면 로그인하십시오.

채택된 답변

Friedrich
Friedrich 2014년 1월 9일
Hi,
this is not possible using xlswrite. You have to do that programatically afterwards using COM/ActiveX, e.g.
ex = actxserver('excel.application');
ex.Workbooks.Open(fullfile(pwd,'Mappe1.xlsx'));
ex.Range('A1:C3').Name = 'RangeName';
ex.ActiveWorkbook.Save
ex.Quit
ex.release
So do a xlswrite to write down the data and afterwards create the named ranges.
  댓글 수: 1
Aitor Vitoria
Aitor Vitoria 2016년 5월 16일
Hi Friedrich,
thanks for the answer.
with your answer, I tried to write in different ways the Range in Excel but always write in the book. there any way to write the ranges in the Sheets?
as it is seen in the image, How I can write a name on the sheet3?
Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by