VIP

[Solved] Why _IECreate() error? ObjCreate("InternetExplorer.Application")

6 posts in this topic

#1 ·  Posted (edited)

Test script:
 

#include <IE.au3>
Local $oIE = _IECreate("http://www.facebook.com/", 0, 0, 1, 0)
If @error Then Exit MsgBox(48, "", "_IECreate() Error", 3)
Local $new_link, $oLinks = _IETagNameGetCollection($oIE, 'a')
If IsObj($oLinks) Then
    For $oLink In $oLinks
        $new_link = $oLink.href
        ConsoleWrite('+ Link: ' & $new_link & @CRLF)
        MsgBox(32, "Results", "Link:" & $new_link & @CRLF)
    Next
    _IEQuit($oIE)
Else
    MsgBox(48, "", "_IETagNameGetCollection() Error", 3)
EndIf

Exit

Local $oObject = ObjCreate("InternetExplorer.Application")
If Not IsObj($oObject) Then
    MsgBox(48, "Error", "_IECreate() Browser Object Creation Failed")
EndIf


Logs:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Administrator\Desktop\New AutoIt v3 Script.au3" /UserParams    
+>21:24:15 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Administrator\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Administrator\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Administrator\Desktop\New AutoIt v3 Script.au3
+>21:24:15 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Administrator\Desktop\New AutoIt v3 Script.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Error from function _IECreate,  (Browser Object Creation Failed)
->21:24:16 AutoIt3.exe ended.rc:1
+>21:24:16 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 1.945

Screen SciTE:

Error.png
Error: --> IE.au3 T3.0-2 Error from function _IECreate,  (Browser Object Creation Failed)

Anyone know why my computer is always error when using  _IECreate() ?
I've forgotten something?

Edited by Trong
solved!

Regards,
 

Share this post


Link to post
Share on other sites



Just now, Dent said:

I'm not at expert but have you tried Local $oIE = _IECreate(http://www.facebook.com/)

So that's without the 0, 0, 1, 0) at the end of the command?

I can't see any url or option in ObjCreate() command, Therefore changing the URL or the options in _IECreate()  to resolve.

Local $oObject = ObjCreate("InternetExplorer.Application")
If Not IsObj($oObject) Then
    MsgBox(48, "Error", "_IECreate() Browser Object Creation Failed")
EndIf

 


Regards,
 

Share this post


Link to post
Share on other sites

Trong, try to kill all iexplore.exe processes and then run your code again. If you still get an error try to reboot.

1 person likes this

Share this post


Link to post
Share on other sites
3 minutes ago, MichaelHB said:

Trong, try to kill all iexplore.exe processes and then run your code again. If you still get an error try to reboot.

Damn, lots of iexplore.exe processes are running!
Kill them and script now work!


Regards,
 

Share this post


Link to post
Share on other sites

_IEQuit($oIE) always at the end of the process :)

Share this post


Link to post
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