The error would suggest that objMenuFrame is not being assigned to an
IFRAME. This is probably down to cross frame security improvements in IE8
preventing this from working, and because you're not checking that
objMenuFrame has the appropriate properties before attempting to use them
you are getting the error. On Error Resume Next won't make this work, it'll
just simply skip that line and any others following that error - so the
divScriptMessage element won't be set to the strMsgIn value.
If you add code to print the value of the error number and description after
the "set objMsgArea = ..." line, what are the values displayed? This will
give you a clue to the source of the problem.
contentWindow is an old IE specific reference, have you tried
contentDocument? This a DOM reference so will be supported by IE8, but not
necessarily by earlier versions.
Where are the HTA files being loaded? If in the My Computer zone then you
will need to add a "mark of the web", as IE8 restricts access via scripting
and contentWindow/contentDocument are amongst the properties that have had
security restrictions applied, but it should work if the file is loaded from
the Internet zone.
And why are you calling ExecCommand with an empty string?
"WCHull" <firstname.lastname@example.org/> wrote in message
> We discovered an issue with some inbedded VBScript code inside an HTA
> written by a developer that is no longer with us. The code work in IE6
> but error out on the set objMsgArea statement indicating that the object
> requires 'objMenuFrame' which should have been set in the previous line of
> code. If I put in an 'On Error Resume Next" statement in that sub the HTA
> appears to work correctly however I don't like putting a band-aid on
> something like this. Does anyone have any solution for this? Here's the
> sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn)
> strCalledFromFunction = strFunctionName
> strFunctionName = "ADA-CommonFunctions:AppStatusDisplay"
> if bolAddToStatusLogIn then
> AppStatus strMsgIn
> end if
> strAppMessage = strMsgIn
> set objParent = self.parent
> if varType(objParent) = vbObject then
> set objMenuFrame =
> self.parent.document.getElementById("ifrMenuFrame" )
> set objMsgArea =
> objMenuFrame.contentWindow.document.getElementById ("divScriptMessage")
> set objMsgArea = divStatus
> end if
> objMsgArea.Innertext = strMsgIn
> call ExecCommand("")
> strFunctionName = strCalledFromFunction
> end sub
> frmsrcurl: http://msgroups.net/microsoft.public...lorer.general/