Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone,

I've an Excel spreadsheet where so many URLs are mentioned by my client to edit them. So currently I go the each URL and open it manually in browser. Which takes up lot of my time and makes me sick of doing the same step again and again.

Can someone please suggest me how to automatically open multiple URLs from an excel sheet. Basically I want an script that automatically identify URLs from the column and open it in the explorer.

Basically, I am not a core developer (I'm a marketing professional, but started learning programming these days).

So, please share a JavaScript or VBScript to automate this kind of process Or direct me how to do this kind of automation so I can learn better.


Cheers,
Rishu Mehra
Posted
Updated 25-Jan-21 7:42am

Could this one help you? Opening an HTML Page in a Macro (Microsoft Excel)[^]


A macro to do this would appear as follows:
Sub DoBrowse1()
    Dim ie As Object
    Set ie = CreateObject("Internetexplorer.Application")
    ie.Visible = True
    ie.Navigate "c:\temp\MyHTMLfile.htm"
End Sub

This macro will open the file c:\temp\MyHTMLfile.htm in a new Internet Explorer window. If you want to instead open a Web page ... (r)eplace the file path with a URL.
 
Share this answer
 
Comments
RishuMehra.Info 28-Jan-16 1:44am    
In this code I need to enter all the URLs again and again whereas I need something that can automatically fetch URLs from all Rows and Columns and populate or navigate them to IE and open them tab by tab.
Konstantin A. Magg 29-Jan-16 0:59am    
ie.Navigate "c:\temp\MyHTMLfile.htm" is kind of the first step.
If this works, make your script read the urls from file.
After this, I would apply a little filter, ignoring invalid urls.

But I see, you can copy-paste this code from the answer below.
Hey,

Thanks for all the help.

Got the Solution. Here is the script:

VB.NET
Sub OpenLinks()
    Dim Cell As Range
    Set LinkRng = Range("A1").CurrentRegion.Columns(1)
    On Error Resume Next
    For Each Cell In LinkRng.Cells
        Cell.Hyperlinks(1).Follow
    Next
    On Error GoTo 0
End Sub


But I need to keep the URLs only in A row and all should Hyperlinked. That still can do my work for now.

Cheers,
Rishu Mehra
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900