Jump to content

ObjName() return NULL


Recommended Posts

Hi,

I need to develop an IE related program, but I notice even the simplest call is not working in my notebook. See below example.

#include <IE.au3>

$oIE_basic = _IE_Example ("basic")

The internet exploer is launched, but nothing is shown. There is error IEStatus_InvalidObjectType

After further debugging, I found the ObjName() call return NULL. I used the below test code to verify.

$oIE=ObjCreate("InternetExplorer.Application")

MsgBox( 0, " The interface of the Object is ", ObjName($oIE ) )

However, when I tested in my another notebook with the same code, everything is fine. Both notebook have installed IE7.

Could anybody advise what is wrong with my notebook?

Thanks a lot.

Link to comment
Share on other sites

Hi,

I need to develop an IE related program, but I notice even the simplest call is not working in my notebook. See below example.

#include <IE.au3>

$oIE_basic = _IE_Example ("basic")

The internet exploer is launched, but nothing is shown. There is error IEStatus_InvalidObjectType

After further debugging, I found the ObjName() call return NULL. I used the below test code to verify.

$oIE=ObjCreate("InternetExplorer.Application")

MsgBox( 0, " The interface of the Object is ", ObjName($oIE ) )

However, when I tested in my another notebook with the same code, everything is fine. Both notebook have installed IE7.

Could anybody advise what is wrong with my notebook?

Thanks a lot.

What's the OS and SP level?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Both WinXP SP3 English version

What do you get in the SciTE console if you run this:
#include <IE.au3>

Global $iTimer = TimerInit()
Global $oIE_basic = _IE_Example ("basic")
$iTimer = Round(TimerDiff($iTimer) / 1000, 3)
If IsObj($oIE_basic) Then
    ConsoleWrite("Time = " & $iTimer & "sec; Name = " & ObjName($oIE_basic) & @LF)
Else
    ConsoleWrite("Time = " & $iTimer & "sec; Not an OBJ" & @LF)
EndIf

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I suspect you have a misbehaving iexplore process. Suggest you kill all iexplore.exe processes or logout or reboot and try again.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

What do you get in the SciTE console if you run this:

#include <IE.au3>

Global $iTimer = TimerInit()
Global $oIE_basic = _IE_Example ("basic")
$iTimer = Round(TimerDiff($iTimer) / 1000, 3)
If IsObj($oIE_basic) Then
    ConsoleWrite("Time = " & $iTimer & "sec; Name = " & ObjName($oIE_basic) & @LF)
Else
    ConsoleWrite("Time = " & $iTimer & "sec; Not an OBJ" & @LF)
EndIf

:)

Below is the output. Thanks for help.

+>22:50:51 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86)

>Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3

+>22:50:52 AU3Check ended.rc:0

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "D:\Temp\test8.au3"

--> IE.au3 V2.4-0 Error from function _IENavigate, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEDocWriteHTML, $_IEStatus_InvalidObjectType (Expected document element)

Time = 6.641sec; Name =

+>22:50:59 AutoIT3.exe ended.rc:0

+>22:51:00 AutoIt3Wrapper Finished

>Exit code: 0 Time: 10.548

Link to comment
Share on other sites

There is no iexpore process when I run the script. Thanks.

Please remember that that this is Windows. I suggest you try the Logout and Reboot suggestions as well. Otherwise you will likely receive the ultimate Microsoft debugging suggestion: reinstall.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Please remember that that this is Windows. I suggest you try the Logout and Reboot suggestions as well. Otherwise you will likely receive the ultimate Microsoft debugging suggestion: reinstall.

Dale

Logout/Reboot not working for the issue. Reinstall AutoIt also not helpful. Reinstall the whole system is what I am not willing to do.

Link to comment
Share on other sites

Suggest you take AutoIt out of the picture with this simple VBScript and then, assuming it fails, go investigate this as a pure windows issue:

Dim objIE
Set objIE = CreateObject("InternetExplorer.Application")
MsgBox TypeName(objIE), 65, "TypeName"
objIE.Visible = True
objIE.Navigate2 "http://www.google.com"

Dale

Edit: added MsgBox

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Suggest you take AutoIt out of the picture with this simple VBScript and then, assuming it fails, go investigate this as a pure windows issue:

Dim objIE
Set objIE = CreateObject("InternetExplorer.Application")
MsgBox TypeName(objIE), 65, "TypeName"
objIE.Visible = True
objIE.Navigate2 "http://www.google.com"

Dale

Edit: added MsgBox

The message box shows "Object".
Link to comment
Share on other sites

The message box shows "Object".

Did you run Dale's VBS verbatim? You should have gotten "IWebBrowser2" (On XP Pro SP2 with IE7, for me).

Getting "Object" means it is seen as a generic object with no custom type name (see TypeName() at W3Schools). So you're back to reinstalling IE at least, it seems.

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Did you run Dale's VBS verbatim? You should have gotten "IWebBrowser2" (On XP Pro SP2 with IE7, for me).

Getting "Object" means it is seen as a generic object with no custom type name (see TypeName() at W3Schools). So you're back to reinstalling IE at least, it seems.

:)

Thanks, I understand it, but the tricky thing is it is still an issue even after I reinstalled IE7.

Even more, I changed a bit to the test vbscript.

Dim obj

Set obj = CreateObject("Excel.Application")

MsgBox TypeName(obj), 65, "TypeName"

For this, it also return "Object".

I changed to "Powerpoint.Application", it also return "Object".

So it turn out to be not just the IE issue. Any other ideas?

Link to comment
Share on other sites

Any other ideas?

Yes, expand your network beyond this forum to look for an answer. You can now see that it is a Windows issue and not an AutoIt issue. Suggest you try the Microsoft Community forums.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...