Search

VBA to open multiple web pages in same Internet Session


Sample Code

Option Explicit
Sub ie_openNew_tab()

'-----------------------------
'Thanks for downloading the code. 
'Please visit our channel for a quick explainer on this code.
'Feel free to update the code as per your need and also share with your friends.
'Channel: Youtube.com/vbaa2z
'Download free codes from http://vbaa2z.blogspot.com
'Autor: L Pamai (vbaa2z.team@gmail.com)
'-----------------------------

    Dim IE As InternetExplorer
    Set IE = New InternetExplorer
    
    IE.Visible = True
    IE.Navigate "http://www.google.com"
     
     'wait for page to load
    Do Until IE.ReadyState = READYSTATE_COMPLETE
        DoEvents
    Loop

        IE.Navigate "https://www.youtube.com/watch?v=9NAePF58L2Y", CLng(2048)
        IE.Navigate "https://www.youtube.com/watch?v=V8s4976Ajfw", CLng(2048)
        IE.Navigate "https://www.youtube.com/watch?v=787tdgvG8oQ", CLng(2048)
        IE.Navigate "https://www.youtube.com/c/vbaa2z?sub_confirmation=1", CLng(2048)
        
    Set IE = Nothing
    
End Sub

No comments:

Post a Comment

Note: only a member of this blog may post a comment.