Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default the Parent property

I see a lot of the objects in the Excel Object Model have this 'Parent'
property.

I am only interested in retreiving the host Workbook for a worksheet, which
brought me to this article:
http://msdn2.microsoft.com/en-us/lib...et.parent.aspx

It worryingly states

"IF the current Worksheet has a parent, then name of the parent workbook is
displayed."

So, I guess my questions is

When would a worksheet not have a parent?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default the Parent property

Good question. Personally I thought that example was crap, but maybe I'm
missing something. I would think the author was trying to say "If Me.Parent
Is Nothing Then 'Me' is not a worksheet" I suspect all worksheets have a
parent.

P.S. if 'Me' is the workbook, not a sheet, then Me.Parent.Name returns
"Microsoft Excel"


"mrmack" wrote:

I see a lot of the objects in the Excel Object Model have this 'Parent'
property.

I am only interested in retreiving the host Workbook for a worksheet, which
brought me to this article:
http://msdn2.microsoft.com/en-us/lib...et.parent.aspx

It worryingly states

"IF the current Worksheet has a parent, then name of the parent workbook is
displayed."

So, I guess my questions is

When would a worksheet not have a parent?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default the Parent property

Under "normal" XL circumstances, .Parent returns the expected object.
However, (untested and only suspicion, test if you want) when you examine
this property in situations of:
- embedded in another OLE file
- shown in a webrowser
- shown in an OLE control
you may get different answers.

I can see that a WS.Parent may not be WB, but I fail to see how it could
Nothing.
How would you create/reference a WS that had no parent.

That code is saying that WS.Parent is either a WB or nothing.

NickHK

"mrmack" wrote in message
...
I see a lot of the objects in the Excel Object Model have this 'Parent'
property.

I am only interested in retreiving the host Workbook for a worksheet,

which
brought me to this article:

http://msdn2.microsoft.com/en-us/lib...et.parent.aspx

It worryingly states

"IF the current Worksheet has a parent, then name of the parent workbook

is
displayed."

So, I guess my questions is

When would a worksheet not have a parent?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default the Parent property

I should add:

That code is saying that WS.Parent is either a WB or nothing.

which seems misleading if the rest of my post correct.

NickHK

"NickHK" wrote in message
...
Under "normal" XL circumstances, .Parent returns the expected object.
However, (untested and only suspicion, test if you want) when you examine
this property in situations of:
- embedded in another OLE file
- shown in a webrowser
- shown in an OLE control
you may get different answers.

I can see that a WS.Parent may not be WB, but I fail to see how it could
Nothing.
How would you create/reference a WS that had no parent.

That code is saying that WS.Parent is either a WB or nothing.

NickHK

"mrmack" wrote in message
...
I see a lot of the objects in the Excel Object Model have this 'Parent'
property.

I am only interested in retreiving the host Workbook for a worksheet,

which
brought me to this article:


http://msdn2.microsoft.com/en-us/lib...et.parent.aspx

It worryingly states

"IF the current Worksheet has a parent, then name of the parent workbook

is
displayed."

So, I guess my questions is

When would a worksheet not have a parent?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
<Parent of the Clipboard Tim Childs Excel Programming 5 May 12th 06 07:35 PM
Parent Folder Bruce Excel Programming 2 September 6th 05 03:40 AM
Runtime Error 380 – Could not set the list property. Invalid property value BernzG[_16_] Excel Programming 2 August 21st 05 10:10 PM
MultiPage Parent Name John Wilson Excel Programming 4 November 19th 04 02:42 PM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"