XLL+ Knowledge BaseXLL+ FAQs

HOWTO: How to Freeze Panes

Reference: Q0047

Article Last Modified on 15-Feb-2008


The information in this article applies to:

How to Freeze Panes

Issue

How do I freeze the panes of a worksheet, like the Window/Freeze Panes command in Excel?

Solution

To freeze the panes of the active worksheet, use code like the following:

static int xlCommand  = 0x8000;
static int xlcFreezePanes = (135 | xlCommand);

int col_split = 2;
int row_split = 3;
int rc = CXllApp::Excel(xlcFreezePanes, 3, &CXlOper(TRUE), 
    &CXlOper((double)col_split), &CXlOper((double)row_split));

To remove the split (like the Window/Remove Split command):

int rc = CXllApp::Excel(xlcFreezePanes, 1, &CXlOper(FALSE));

Copyright © Planatech Solutions Ltd 2002-2008. All trademarks are the properties of their respective owners.