View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default FreezePanes is a window property

In message of Fri, 9 Dec 2016 20:51:31 in
microsoft.public.excel.programming, GS writes
In message of Fri, 9 Dec 2016
10:02:06 in microsoft.public.excel.programming, Walter Briscoe
writes
I run Excel 2003.
I have a particular workbook, consisting of 3 sheets.
Sometimes, I save it with one displayed sheet and sometimes with
more than one.
Each sheet had FreezePanes set.
I sometimes lose FreezePanes, when I switch from sheet to sheet.
After some considerable time being irritated with this, I now
understand it.
I wrote my first event procedure - I don't count auto_open.


[snip]

Where are events enumerated?


By googling excel event name descriptions, I found worksheet events
enumerated and described in
<https://msdn.microsoft.com/en-us/lib....tools.excel.w
orksheet_events.aspx
I also found
<https://msdn.microsoft.com/en-us/lib....tools.excel.w
orkbook_events.aspx
I can probably find others.


Note that you can manage sheet events in ThisWorkbook as you've done
here, but that it can also be done with an events handler class. This
might be a better alternative since all code in ThisWorkbook is subject
to not work correctly if the workbook becomes corrupted for any reason.


Where would I put an events handler class to escape corruption?
I find Microsoft's standard events are not raised as I expect.
e.g. <https://msdn.microsoft.com/en-us/lib...ffice.tools.ex
cel.workbook_events.aspx says:
SheetActivate Occurs when any sheet is activated.

When a workbook is opened, "Open Occurs when the workbook is opened.",
but SheetActivate is not raised, even if a sheet is shown on screen.

My only experience of classes is copies I have made in the last couple
of weeks.
--
Walter Briscoe