On 1/4/2010 11:38 AM, Aaron Smith wrote:
So even if you don't know exactly what the error report says, you still know everything you need: the ModuleName property is trying to be retrieved from an object that's not a Window object, meaning either Win or Win.Parent is returning Nothing (or something other than Window).

It's worth noting that Window.Parent is not guaranteed to return a window. If you ask for the parent of a window that doesn't exist, or for the parent of the desktop window (which has no parent), you'll get the Application object.

It could be argued that Nothing would be a better answer, but Parent is one of the two properties that's required by COM Automation, and I suspect (but have not confirmed) that it's not allowed to be Nothing.

Reply via email to