Open Hyperlink in VBA and keep Login Credentials

dman78

New Member
Joined
Oct 22, 2016
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have hyperlinks in my excel file that I want to open individually when I need to. The website requires a Login an Password. I use VBA to login to the website an then when I want to navigate to a hyperlink it takes me back to the login page.

Is there a way that I can open the hyperlink and keep the login/password.

Is it possible to somehow use .Navigate with the hyperlink instead of "clicking on the cell that contains the hyperlink" through VBA?

VBA Code:
Sub Core_Closure_Date()

' Navigate to Login Page
    Dim IE As Object
     
    Set IE = CreateObject("InternetExplorer.Application")
    
    With IE
        .Visible = True
        .Navigate "https://secure.corporate_website.jsp"
    Do While IE.ReadyState <> READYSTATE_COMPLETE
        Loop
        .Document.all.Item("UserName").Value = "********"
        .Document.all.Item("Password").Value = "******"
        .Document.querySelector("button[Class='ui-state-default']").Click
 
        Do Until IE.ReadyState = 4: DoEvents: Loop
    
    
    
' Navigate to Hyperlink
With IE
        .Visible = True
        ActiveCell.Select
        ActiveCell.Offset(0, 21).Select
        ActiveCell.Hyperlinks(1).Follow
   


  
End With
End With

End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top