'Unable to set FreezePanes property of Window class"

When I check the box to freezepanes in the galactic solutions excel exporter i get that error.  anyone familiar with it?  thanks.


bmohamed - Sat Nov 29 13:46:41 EST 2014

Re: 'Unable to set FreezePanes property of Window class"
llandale - Tue Dec 02 16:22:43 EST 2014

I beat my head against the wall and came up with this; which you can figure out.

//*******************************************************
void fExcel_FreezePanes(OleAutoObj in_oleWSheet, int in_iCol, in_iRow)
{ // Freeze Panes relative to the specified Column and Row;
 // Column and Row are the ones to be split.
 // Use Row/Col zero to ignore that factor.  (In fact, negative numbers also ignore)
 // To freeze the top row, set Row=1 and Col=0.
 // To freeze top row and left col, set Row=1 and Col=1
 //  Note this is different from the GUI, where you would select cell B2

 if (null in_oleWSheet)  then return()

 OleAutoObj oleWBook, oleWindow

   // Get handle on the Sheet's Window:
 fOle_OK(oleGet   (in_oleWSheet, "Parent", oleWBook), "ParentOf")
 oleWindow = fExcel_Window_Active(oleWBook)

  // Activate the Sheet
  // Select top Column/Row, to make sure it is in view
  // Turn off FreezePanes, if any
  // Define the Column Row
  // Turn on  FreezePanes:

 fOle_OK(oleMethod(in_oleWSheet, "Activate"), "ActivateSheet")
  // infoBox("After select A1")
 fOle_OK(olePut   (oleWindow, "FreezePanes", false),   "FreezePOff")
 fOle_OK(olePut   (oleWindow, "Split",       false),   "SplitOff")
    // Scroll to beginning of sheet
 fExcel_TopOf(in_oleWSheet)
 fOle_OK(olePut   (oleWindow, "SplitColumn", in_iCol), "SplitCol")
 fOle_OK(olePut   (oleWindow, "SplitRow",    in_iRow), "SplitRow")
 fOle_OK(olePut   (oleWindow, "FreezePanes", true),    "FreezePOn")

 fOle_Handles_Delete(oleWBook, oleWindow)

} // end fExcel_FreezePanes()

fOle_OK() is just my clever "checkRes()".

It appears in this poorly commented function, that you can only freeze something that you are looking at.

-Louie