+ Reply to Thread
Results 1 to 3 of 3

Open list of https csv file links and save the files

  1. #1
    Registered User
    Join Date
    11-03-2021
    Location
    Austin
    MS-Off Ver
    Pro Plus 2016
    Posts
    1

    Open list of https csv file links and save the files

    Hi y'all!

    long time reader, finally setup an account, first post (hope I'm doing this correctly). Excited to be here!

    I'm a beginner with VBA, so please let me know if there are simple things I'm missing.


    My current issue: I have a list of hyperlinks to .csv files that need to be opened in a browser, which will download and open the csv files. Then I need to save the csv files.

    The links are to bureau of labor statistics data for 9 naics codes, by quarter, from 2017 Q1 through 2021 Q2 (most recent available).

    I tried this code to open the hyperlinks in batch, and all the tabs opened in my browser, but the files didn't open.

    Sub BatchOpenHyperLinks_Workbook()
    Dim objWorksheet As Excel.Worksheet
    Dim objSelectedRange As Excel.Range
    Dim objHyperlink As Excel.Hyperlink

    'Process each worksheet
    For Each objWorksheet In ThisWorkbook.Sheets
    For Each objHyperlink In objWorksheet.Hyperlinks
    objHyperlink.Follow
    Next
    Next
    End Sub


    The next wrinkle is that a number of the files are going to open with the same name, which is the naics code. The period isn't contained in the file name of the read only csv that opens when the link is clicked.

    Ideally, I would like to make a code that opens all the files and saves them with the appropriate names (naics-year-quarter) as excel workbooks, though automating any part of this process would be beneficial.

    Any help would be greatly appreciated!

    TIA!
    Dan
    Attached Files Attached Files
    Last edited by fpanda009; 11-03-2021 at 10:32 AM.

  2. #2
    Registered User
    Join Date
    06-02-2018
    Location
    Italy
    MS-Off Ver
    2013-2019
    Posts
    31

    Re: Open list of https csv file links and save the files

    See this article:
    Excel & VBA: Download Internet Files Automatically – 2 Macros
    https://myengineeringworld.net/2013/...net-files.html

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Open list of https csv file links and save the files

    Like this, you'll need to change FOLDER_PATH to where you want the files

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Open File / Copy Sheet / Break Links / Save As
    By lofgren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2020, 04:34 PM
  2. Replies: 2
    Last Post: 03-10-2020, 11:34 AM
  3. [SOLVED] Check if file is already open...don't open if file true - https://
    By DJDRU in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-31-2017, 10:46 AM
  4. Macro to Open Excel file, Update links, and Save
    By harry1013 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2017, 01:17 PM
  5. Macro to open, update links, save then close all files in sub folders
    By msdelaney in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2015, 05:48 PM
  6. Open Https excel file giving user and password
    By jesusnpadilla in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-17-2014, 11:10 PM
  7. Open Https excel file giving user and password
    By jesusnpadilla in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2014, 12:58 PM

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