Reference: Q0047
Article Last Modified on 15-Feb-2008
How do I freeze the panes of a worksheet, like the Window/Freeze Panes command in Excel?
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));