Set Column width of Excel through Matlab

조회 수: 15 (최근 30일)
Vincenzo
Vincenzo 2011년 12월 21일
이동: Rik 2024년 6월 30일
Hi, I tried to set the width of a column but i don't try..
i found a hint here:
and i simply call it (in another file which I open excel) with xlsAutoFitCol('myfile.xls','Sheet1','A:S'); but nothing change... that's what appears to me...
and what i want...
Someone can help me?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 12월 21일
Something like this.
ExcelApp=actxserver('excel.application');
ExcelApp.Visible=1;
NewWorkbook=ExcelApp.Workbooks.Open(ExcelFile);
NewSheet=NewWorkbook.Sheets.Item(1);
NewRange=NewSheet.Range('A1');
NewRange.ColumnWidth=40;
  댓글 수: 2
Vincenzo
Vincenzo 2011년 12월 21일
이동: Rik 2024년 6월 30일
Great Fangjun!!
Music to my ears!!
Rik
Rik 2024년 6월 30일
Minor downside: this requires Windows and Excel.

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

추가 답변 (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