Jump to content
JoeBar

ie.au3 doesn't work

Recommended Posts

Hi, i don't know if it's my Windows 10 or not but i cannot use any fonction of ie.au3.

For example, this from : example-proper-usage-ieau3-udf-with-autoit-v3314x

#include <ie.au3>
#include <MsgBoxConstants.au3>

; STEP 1
; YOU MUST SET ANY COM ERROR HANDLER IN ONE OF THE FOLLOWING WAY

; STEP 1: CASE 1
; you should set COM Error Handler Function for ie.au3 UDF
_IEErrorHandlerRegister(_User_ErrFunc)

; STEP 1: CASE 2
; eventually if you not want to recieve additional information
; you can use just the same function without parameter
; _IEErrorHandlerRegister()

; STEP 1: CASE 3
; or use your own global COM Error Handler
;~ Global $oCOMErrorHandler = ObjEvent("AutoIt.Error", _User_ErrFunc)

; STEP 2
; if you do not wish to get in Console Output Pane information like the following:
;           --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType
;   You can uncomment this following line:
;       _IEErrorNotify(False)


_Example()
Func _Example()

    ; First lets create some IE Object
    Local $oIE = _IECreate('google.com')
    ; you should always check for @error in any function (even you own made)
    If @error Then
        MsgBox($MB_ICONERROR, '_IECreate', '@error = ' & @error & @CRLF & '@extended = ' & @extended)
        ; Set @error when you return from function with Failure
        Return SetError(1,0,0)
    Endif

    ; here we try to get reference to LuckyStrike button
    Local $oLuckyStrike = _IEGetObjByName($oIE, 'btnI')
    ; you should always check for @error in any function (even you own made)
    If @error Then
        MsgBox($MB_ICONERROR, '_IEGetObjByName', '@error = ' & @error & @CRLF & '@extended = ' & @extended)
        ; Set @error when you return from function with Failure
        Return SetError(2,0,0)
    Endif

    ; here we try to click LuckyStrike button with previously achieved Object which is a reference to HTML DOM OBJECT in IE Instance
    _IEAction($oLuckyStrike, 'click')

    ; you should wait when page is loading
    _IELoadWait($oIE)

    ; some user interaction
    If MsgBox($MB_YESNO, 'Question', 'Do you want to back ?') = $IDYES Then
        _IEAction($oIE, 'back')
    EndIf

EndFunc   ;==>_Example



; User's COM error function.
; After SetUp with ObjEvent("AutoIt.Error", ....) will be called if COM error occurs
Func _User_ErrFunc($oError)
    ; Do anything here.
    ConsoleWrite(@ScriptFullPath & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
            @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
            @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
            @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
            @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
EndFunc   ;==>_User_ErrFunc

gives me :

E:\Portable\Dev\AutoIt3\tests.au3 (215) : ==> COM Error intercepted !
    err.number is:      0x800401F3
    err.windescription: Chaîne de classe incorrecte

    err.description is:     
    err.source is:      
    err.helpfile is:    
    err.helpcontext is:     
    err.lastdllerror is:    0
    err.scriptline is:  215
    err.retcode is:     0x00000000

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

The error is already at Local $oIE = _IECreate('google.com') .

I think IE is broken since the lastest Windows Updates, but i'm not sure, do you have the same problem ? I have W10 with lastest updates.

 

I reinstalled IE11 64bits, same message.

Thanks.

Edited by JoeBar

Share this post


Link to post
Share on other sites

If i can't use IE anymore, can i use other "engine" internally (not interacting with an actual FF or Chrome window) to make operations (naviguate, fill forms, follow links...)

I've seen WebDriver UDF and IUIAutomation MS framework but it allows to control an existing FF/Chrome window, if i'm not wrong.

Share this post


Link to post
Share on other sites
12 hours ago, JoeBar said:

I think IE is broken since the lastest Windows Updates, but i'm not sure, do you have the same problem ? I have W10 with lastest updates.

I updated my workstation yesterday to the Nov updates, and I can still launch IE fine using _IECreate. Therefore, there's something wrong with your Windows installation.

What happens when you issue the follow command?

Local $oObject = ObjCreate("InternetExplorer.Application")

 

Share this post


Link to post
Share on other sites
36 minutes ago, Danp2 said:

What happens when you issue the follow command?

Local $oObject = ObjCreate("InternetExplorer.Application")

 

No problem with this command.

Share this post


Link to post
Share on other sites
Just now, Danp2 said:

Can you comment out the following line and then rerun your script?

_IEErrorHandlerRegister(_User_ErrFunc)

Also, what version of Autoit are you using?

It does exactly the same (without extended error description) :

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

 

Share this post


Link to post
Share on other sites
14 hours ago, JoeBar said:

_IEErrorHandlerRegister(_User_ErrFunc)

Shouldn't the _IEErrorHandlerRegister() function's parameter be a string, like:

_IEErrorHandlerRegister("_User_ErrFunc")

 

Share this post


Link to post
Share on other sites

Both work.  AutoIt functions are now first-class citizens and this form is preferable.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
16 minutes ago, Danp2 said:

Have you tried rebooting or killing all iexplore processes?

I have no iexplore process, also i only found "iexplore.exe" files in "C:\Windows\servicing\LCU\Package_for_RollupFix..." not elsewhere.

Is there a problem ?

Share this post


Link to post
Share on other sites

Is Internet Explorer installed on the computer?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Is Internet Explorer 11 enabled in "Windows Features"?  If so, maybe disabling it and re-enabling it will clean up all of the references and system files.

image.png.756d065a542e1d75dd6424ad805538ea.png

Share this post


Link to post
Share on other sites

I have no such feature in my "Windows Features", that's why i reinstalled IE11.

At the root of "C:\Program Files\Internet Explorer" the only exe files are "ieinstal.exe" and "ielowutil.exe".

It's weird.

Edited by JoeBar

Share this post


Link to post
Share on other sites

What stupid i am, i had deactivated it at Windows Install Time, that's why i couldn't see it in "Windows Features".

After 3h of Internet research, i found it alone ...

It's in Apps and Features, just above Alias ...

 

That even prevented me to reinstall IE with the installer from M$.

 

Thanks to all for your time !

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

×
×
  • Create New...