Set Column width of Excel through Matlab

12 visualizaciones (últimos 30 días)
Vincenzo
Vincenzo el 21 de Dic. de 2011
Movida: Rik el 30 de Jun. de 2024
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?

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 21 de Dic. de 2011
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 comentarios
Vincenzo
Vincenzo el 21 de Dic. de 2011
Movida: Rik el 30 de Jun. de 2024
Great Fangjun!!
Music to my ears!!
Rik
Rik el 30 de Jun. de 2024
Minor downside: this requires Windows and Excel.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by