We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How can I fix some columns

Hello,

How can I fix the columns A+B so that these columns always can be seen?

thanks

Hi,

Thanks for considering Aspose.

Yes, you can freeze panes using Cells.FreezePanes() method.

May the following sample code help you for your need:

OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=d:\\test\\Northwind.mdb");
con.Open();
OleDbCommand cmd = new OleDbCommand("Select * from Employees",con);
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds,"Employees");
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
// Import the datatable
ws.Cells.ImportDataTable(ds.Tables["Employees"], true, "A1");
//Freeze the first two columns i.e, A and B.
ws.FreezePanes(0, 2,0, 2);
wb.Save("d:\\test\\frozencols.xls",Aspose.Cells.FileFormatType.Excel2003);
For further ref, please check the wiki doc: http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/FreezePanes.html
Thank you.