Jump to content

IE with ScreenUpdating Off


Recommended Posts

This is a strange issue I've been having since I started trying to control IE with AutoIt. It's sporadic, but seems to happen mostly when IE isn't already open and hasn't been used in a while (like when I come in to work first thing in the morning). It's like IE has Excel's Application.ScreenUpdating set to false. It doesn't seem to matter what website I use, it can happen to any of them. My company does seem to have a proxy set up, but I can't seem to get the properties of it (various websites can't detect it, and IE's properties are set to auto-detect). This is a basic setup of my IE code...

Local $website = "some.website.where.I.login"

_IEErrorNotify(True) ; <-- Is there a way to write these to a log? That would be great for testing!

; Create IE (never issues here)
Local $ie = _IECreate("about:blank")
If @error then Exit

; Move to requested website
_IENavigate($ie, $website)
If @error Then
    ; It's okay, sometimes I need to attach to it
    _IEAttach($website, "url")
    If @error Then
        ; Super annoying, try again in a couple seconds
        Sleep(2000)
        _IEAttach($website, "url")
        ; If it fails, I give up
        If @error Then Exit
    EndIf
EndIf

; Usually, code makes it here. Sometimes though, the screen won't update and IE appears to be in a frozen state.
; It will still complete every request I make of it
; For example, it will still download my invoice while not showing me as being logged in to the website

Local $oUsername = _IEGetObjById($ie, "username")
$oUsername.value = "seadoggie"
Local $oPassword = _IEGetObjById($ie, "password")
$oPassword.value = "poohbear123" ; Not my password
Local $loginBttn = _IEGetObjById($ie, "login")
_IEAction($loginBttn, "Click")

; Bunch of other IE actions that work well and download an invoice

Other (Useful?) Information:
  Windows 10: Version 1709, Build: 16299.1387
  IE Version 11.1387.16299.0
  IE Update Versions: 11.0.145
  AutoIt Version: 3.3.14.5
  IE.au3 Version: T3.0-2

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

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...