Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SendKeys For Windows Security Login Window Problem

    I have outdated and no-longer-supported Axis brand security cameras that I have to access via the their IP addresses on my local LAN. When I point Internet Explorer to their IP addresses a "Windows Security" small window pops up requesting username and password, which I then enter and then I can get into the security camera. I am trying to automate this with a 1-button click using my extremely limited programming skills. I got it to work -- kind of -- using the following code, but the problem is that if the camera has been logged into recently then it doesn't ask for username and password and consequently the SendKeys function has Internet Explorer search the web for the pre-programmed password because it puts the password on the address bar/search of the browser rather than sending the password text to the Window Security window which isn't there. Is there a way to fix this or do this better than my stupid way? I will paste the code below, but is there a better language that I should be using than Visual Basic for which I could download the programming environment? I have a feeling someone out there could write this entire code over and in a better way in 10 seconds than what I came with below that took me several hours (embarrassed!):
    Sub Button1_Click()
    '
    ' Button1_Click Macro
    Set oIE = CreateObject("InternetExplorer.Application")
    sUsername = "user123"
    sPassword = "password123"
    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.Visible = True
    oIE.navigate "10.114.143.55"
    Application.Wait Now + TimeSerial(0, 0, 3)
    SendKeys sUsername & "{TAB}"
    Application.Wait Now + TimeSerial(0, 0, 1)
    SendKeys sPassword & "{ENTER}"
    End Sub

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,276
    Thanks
    10
    Thanked 581 Times in 562 Posts
    are the cameras view-able using chrome? or firefox? both have many extensions that would make the task a breeze.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •