Freeze panes

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
mdonath
Posts: 23
Joined: Fri Oct 05, 2012 11:36 am

Freeze panes

Post by mdonath »

Is there an opportunity to freeze panes in an Excel sheet using TXLSReadWriteII4?

Markus
mdonath
Posts: 23
Joined: Fri Oct 05, 2012 11:36 am

Re: Freeze panes

Post by mdonath »

Maybe nobody knows what I was asking for. In Excel you can freeze panes here:

https://www.dropbox.com/s/alcvvcj58ii3x ... ePanes.PNG


Markus
Joe Griffin
Posts: 13
Joined: Tue Feb 13, 2007 8:47 am
Location: West Sussex England

Re: Freeze panes

Post by Joe Griffin »

I think what you want is (something like) ...

Code: Select all

  // Fix the top rows for scrolling
  CurrentSheet.Pane.PaneType := ptFrozen;
  CurrentSheet.Pane.SplitColX := 1;
  CurrentSheet.Pane.SplitRowY := 4;
  CurrentSheet.Pane.LeftCol := 1;
  CurrentSheet.Pane.TopRow := 4;
Hope that helps
Joe Griffin
GerbilSoft Associates Limited
mdonath
Posts: 23
Joined: Fri Oct 05, 2012 11:36 am

Re: Freeze panes

Post by mdonath »

Sounds good, but causes nothing.
Is the something necessary to apply these changes?

Markus
DrTob
Posts: 20
Joined: Tue Jul 19, 2011 2:31 pm

Re: Freeze panes

Post by DrTob »

You have to add soFrozenPanes to the sheet options:

Code: Select all

CurrentSheet.Options := CurrentSheet.Options + [soFrozenPanes];
mdonath
Posts: 23
Joined: Fri Oct 05, 2012 11:36 am

Re: Freeze panes

Post by mdonath »

Ok, I did this (RADStudio 2010, C++ Builder):

Code: Select all

	XLSReadWriteII41->Version = xvExcel2007;
	XLSReadWriteII41->Sheets->Items[0]->Options = XLSReadWriteII41->Sheets->Items[0]->Options << soFrozenPanes;
	XLSReadWriteII41->Filename = L"test.xlsx";
	for(int i=0; i<=10; i++)
		for(int j=0; j<=10; j++)
			XLSReadWriteII41->Sheets->Items[0]->AsString[i][j] = L"Test[" + IntToStr(i) + L";" + IntToStr(j) + L"]";
	XLSReadWriteII41->Sheets->Items[0]->Pane->PaneType = ptFrozen;
	XLSReadWriteII41->Sheets->Items[0]->Pane->SplitColX = 1;
	XLSReadWriteII41->Sheets->Items[0]->Pane->SplitRowY = 4;
	XLSReadWriteII41->Sheets->Items[0]->Pane->LeftCol = 1;
	XLSReadWriteII41->Sheets->Items[0]->Pane->TopRow = 4;
	XLSReadWriteII41->Write();
But unfortunately there is no frozen pane in the result file.
DrTob
Posts: 20
Joined: Tue Jul 19, 2011 2:31 pm

Re: Freeze panes

Post by DrTob »

axolot.com/components/xlsrwii20.htm wrote:The support for Excel 2007 files is right now limited to read/write cell values and formatting.
Post Reply