Select multiple range using Matlab Activex Server
이전 댓글 표시
I want to write the results of a data analysis with Matlab to an Excel spredsheet. To get it more handy and nice i also tried to format the content.
Because formating every single cell or range is very slow I tried to format a multiple range - but I didn't manage to get it running.
I recorded a macro directly with Excel that shows in principle, what i wanted to do:
Range("B355:AG359,B365:AG369").Select
Range("B365").Activate
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Color = -16776961
.TintAndShade = 0
.Weight = xlThin
End With
Now I tried to do it with Matlab ...
xls = actxserver('Excel.Application');
xlsDatei = xls.Workbooks.Open(xlsFileName);
myBook = xlsDatei.Sheets.Item(p);
myBook.Activate;
myRange = myBook.Range('B355:AG359,B365:AG369');
And this is the point - i always the following Matlab error:
Error using Interface.000208D8_0000_0000_C000_000000000046/Range
Error: Object returned error code: 0x800A03EC
Perhaps there who has done this before and can help me.
댓글 수: 2
Walter Roberson
2019년 4월 16일
The error code appears to signify a range that is invalid or does not exist in the spreadsheet. Or trying to access beyond row 65535 in an xls file.
Stefan
2019년 4월 16일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 ActiveX에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!