Change cell's WIDTH programmatically

M

Marat

I've tried to change cell's WIDTH programmatically, but it
seems that this property is ReadOnly.
Is there any way that will allow me to change cell's WIDTH
programmatically, say from 100 pixels to 200 pixels?

TIA
 
C

Chip Pearson

Marat,

You can change the ColumnWidth property, which is measured not in points but
by the number of '0' characters in the default font that can be displayed in
the cell -- e.g., a ColumnWidth of 8 is wide enough to display eight '0'
characters.

To convert between this measurement and points, set the ColumnWidth to 1 and
read the Width property. Divide the desired number of points by Width value
of a cell whose ColumnWidth is 1. In Arial 10, this is about 9
points/character.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top