Working with Internet Explorer Object using vba

This Page will cover programming on internet explorer using VBA language.

1) How to open a Web Page into a New window using VBA.

Step 1: Open an excel file.

Step 2: Navigate to VB Editor  after pressing Alt + F11 keys.

Step 3:Insert a Module into the editor and put the below mentioned code in it.

Public Function InvokeWebPage()
   
     ActiveWorkbook.FollowHyperlink _         
'Put the Page Address over here to invoke the browser.Kindly include http into that without http it will not work.
    Address:="http:\\www.google.com", _      
   
    NewWindow:=True, _   'This line will open it in new window.   
   
    AddHistory:=True         'It will add into the history of web browser.
   
     Application.WindowState = xlNormal   'Set the default state to normal

End Function


Comments