View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default FreezePanes is a window property

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

When a workbook is opened, "Open Occurs when the workbook is
opened.",
but ShSheetActivate 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.


This would be a class component in your project. Given the amount of
programming you've done over the years (some of it fairly complex), I
recommend you get a copy of *Professional Excel Development* if you
don't already have it...

http://www.appspro.com/Books/Books.htm

...because it describes in detail how to put together a global events
handler for your projects. Note that this book (and mentoring by its
author Rob Bovey) is the prime source for my learning and growing my
Excel development skills.

Note that there are quirks when developing with global event handlers
that are easily managed via a switch that allows you to turn event
handling on or off at any time. The most noticed quirk is global vars
losing their values/refs.

I use a standard module named 'm_OpenCclose' to handle startup,
shutdown, and global defs/initialization. It includes the autorun
macros 'Auto_Open' and 'Auto_Close' to replace the workbook 'Open' and
'BeforeClose' events. It's also where I def all globals and their
initialization via sub 'InitGlobals'. (This also serves to
re-initialize during runtime if required)

I use a global event handler named 'cAppEvents' to manage all other
events, which gets switched on at startup. Event handling switches are
'StartEventHandling', 'StopEventHandling' and 'ResetEventHandling'
which are located in m_OpenClose.

Setting all this up is a 'per project' thing mostly, and so I start a
new project with a blank template and go from there.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion