Free Support Forum - aspose.com

How to use SetColumnWidth

Hello,

I want to hide a column with SetColumnWidth how I use this method after:

_Cells[110,2].PutValue("text")

thanks

I have found it:

_Cells.SetColumnWidth(cells.ColumnNameToIndex("F"), 30)

Hi,

Yes, and to completely hide a column / row you may use Cells.HideColumn()\HideRow() methods

Thank you.

cells.SetColumWidth(2,200) and cells.SetColumWidthPixel(2,200) doesn't work.

Is there any more to do?

Hi,

I find no difficulty to implement both these methods.

Following is my testing code and attached is the output file.

Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets["Sheet1"];
Cells cells = ws.Cells;
cells.SetColumnWidth(0, 200);
//cells.SetColumnWidthPixel(0, 200);
cells[0, 0].PutValue("Voor meer informatie ga naar de Informatiepagina ldsjfa lasjdfl jlkajdsflk lkdsf salka lkfds lkdsa a lkf dlkj end");
wb.Save("d:\\test\\columnwidthset.xls", FileFormatType.Excel2003);
Thank you.

Hi,

And by the which version of Aspose.Cells you are using. I think you may try the attached latest version (fix).

Thank you.