Free Support Forum - aspose.com

Specifying the cell to split a worksheet at

Hi,

I can't work out how to split a worksheet at a particular cell. The Worksheet.FreezePanes method takes a cell plus row and column counts as arguments, however, the Worksheet.Split method doesn't take any arguments. Is there a way I can specify the cell to split at, or is the default split option (where it splits approximately in the middle of what I can see of the worksheet when I open it) the only option?

Thanks,
Shandos Cleaver

To split at a specified cell, there are some complex calculation to adjust the window which I am not sure about it. Currently the default split option is the only option.

Thanks for answering. Also - I want to thank you for a great product, I've found it very easy to use.

Shandos

Sorry to bring this thread back to life, but I’d like to know if you’ve managed to make this work.

Thanks.

Hi,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

You can set the active cell before applying the split panes option to achieve your desired result. Please see the following sample code in this regard:

Workbook book = new Workbook();

book.Open("C:\\output.xls");

book.Worksheets[0].ActiveCell = "H15";

book.Worksheets[0].Split();

book.Save("C:\\Split_out.xls");

Thank You & Best Regards,