Closed Thread
Results 1 to 2 of 2

Secure website and use cells for username/pass

Hybrid View

  1. #1
    Registered User
    Join Date
    09-30-2008
    Location
    Fremont
    Posts
    21

    Secure website and use cells for username/pass

    Sub myWebOpenPW()
    'Open site if it requires a PassWord Model!
    Dim IE As Object

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True

    'Go to this Web Page!
    IE.Navigate "http://YourLoggOnPageAddress_GosHere"

    'Check for good connection to web page loop!
    Do
    If IE.ReadyState = 4 Then
    IE.Visible = False
    Exit Do
    Else
    DoEvents
    End If
    Loop

    'Wait for window to open!
    Application.Wait (Now + TimeValue("0:00:01"))
    'MsgBox "Done"
    IE.Visible = True

    'Send logg-on information!
    'May need additional SendKeys as needed?
    'Determine by the actual key-stroks needed!
    SendKeys "UserID_GosHere", True
    SendKeys "{TAB}", True
    SendKeys "PassWord_GosHere", True
    SendKeys "{ENTER}", True
    End Sub


    Is there a way to get this to work on lets say you are on an active sheet

    in cell A1 you have
    Enter User Name:

    in cell A2 you have
    Enter Password:

    in B1 you enter your Username
    in B2 you enter your password

    When you click a button that is tied to the code above it would put the values from B1 and B2 in the code...

    eg.

    'Send logg-on information!
    'May need additional SendKeys as needed?
    'Determine by the actual key-stroks needed!

    SendKeys "UserID_GosHere", True <<<<<<<<<<<< B1 in place of "UserID_GosHere"
    SendKeys "{TAB}", True
    SendKeys "PassWord_GosHere", True <<<<<<<<<<< B2 in place of "PassWord_GosHere"
    SendKeys "{ENTER}", True
    End Sub

    Once the Webmail page opens up automatically attach the Activesheet Clearing B1 & B2

    and automatically put 2 recipients of the email in the TO section of the webmail app.

    Lastly when you are done sending the Webmail save the active sheet with the current day and time in say C:\timesheets when you Close the Workbook automatically save on Exiting the Workbook.

    The Subject should have something to the effect of

    Timesheet email for (todays date which I believe would be =Now), for the week of (The first sunday of the current week).

    Thank you so much.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thread closed for

    1) Unwrapped code
    2) Cross posting again without link
    3) Ignoring mods request to add the links

    You can start a new thread if you read the forum rules below and then start following them

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1