Page 1 of 1

[Solved] Set columns and rows autofix with code

Posted: Thu Jan 30, 2025 5:11 am
by luofeiyu
Set columns and rows autofix manually:

format--rows--optional height
format--columns--optional width

How can set columns and rows autofix with code?
Suppose that there are many ods file in the directory `data`,every ods workbook contains 10 worksheets in it.

Re: Set columns and rows autofix with code

Posted: Thu Jan 30, 2025 8:34 am
by Zizi64

Code: Select all

ThisComponent.sheets(0).columns(0).optimalwidth = true
You can organize this API function into a program loop.