View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Confusion about how the Window object fits into the Excel object model

Until Excel version 5, a worksheet, workbook and window were synonymous
since there were only one each (there really was no workbook). So I suspect
it somewhat evolved from that.

--
Regards,
Tom Ogilvy

"Josh Sale" <jsale@tril dot cod wrote in message
...
Thanks Tom. I thought I was going crazy.

Any idea why the Excel designers would have chosen to make these worksheet
properties private and only expose them via the Window object? Seems odd

to
me.

I only started looking at Excel's object model starting with XL97. I

wonder
if this is some kind of artifact from earlier versions of Excel where

these
appearance settings might have cut across worksheets and workbooks (i.e.,
perhaps in XL1 they really were specific to the window and not what's
displayed in it)?

Again thanks for the response.

josh




"Tom Ogilvy" wrote in message
...
I would imagine the attributes are stored as part of the worksheet
information since they are specific to the worksheet. However, they are
not
directly accessible through the worksheet object. When a worksheet is
activated, I assume the window gets the setting from the worksheet
attributes. A workbook stores a calculation setting, but it is set
through the application object as another example of something similar.

--
Regards,
Tom Ogilvy

"Josh Sale" <jsale@tril dot cod wrote in message
...
I'm a bit confused about how the Window object fits into the Excel

object
model and am hoping somebody can set me straight. Here's my deal ...

My application wants to create a new worksheet and have its gridlines

and
headings be set the same as another worksheet in a different workbook.

I
understand that the DisplayGridlines and DisplayHeadings properties are

part
of the Window object and not the worksheet object. In fact if you

search
through all of the properties of a workbook and its constituent parts

you
can't find anything that controls these two apparent aspects of the
worksheet.

Yet, if you go to Tools | Options and check or uncheck these properties
to
change the appearance of the currently active worksheet, save the
workbook
(which presumably doesn't save the active window) and then reopen the
workbook, the gridlines and headings are restored to their state at the

time
of the save.

So presumably, these properties of the window are being saved with the
workbook? But where? What am I missing?

It bugs me to have this gap in my mental model of how Excel is strung
together. Again I hope somebody will set me straight on how this hangs
together.

TIA,

josh