Set Column width of Excel through Matlab

10 次查看(过去 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