Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
<Parent of the Clipboard | Excel Programming | |||
Parent Folder | Excel Programming | |||
Runtime Error 380 – Could not set the list property. Invalid property value | Excel Programming | |||
MultiPage Parent Name | Excel Programming | |||
Runtime error 380: Could not set the List property. invalid property value of listbox | Excel Programming |