+ Reply to Thread
Results 1 to 4 of 4

open , save & close multiple hyperlinks VBA

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    uk
    MS-Off Ver
    2007
    Posts
    1

    open , save & close multiple hyperlinks VBA

    Hi ,

    I'm trying to create a VBA code to open , save ( in the same location it is currently saved ) and close a number of files which are all interlinked. This is to help save me time when it comes to refreshing data.

    I want to put all the hyperlinks in Column A , and i have tried recording the following macro and then playing around with it so that it opens any links from A9:A200. I currently might only have 50 files to open , but i want to be able to add additional links in the future if needed.

    The code currently is :

    Sub OSC()
    '
    ' OSC Macro
    ' Open save and close
    '

    '
    Range("A9:A50").Select
    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    ActiveWorkbook.Save
    ActiveWindow.Close

    End Sub

    however this only opens and saves the 1st hyperlink.

    Any help here would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    04-07-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    34

    Re: open , save & close multiple hyperlinks VBA

    Here, For Loop can be added to do this for all the links in the selection and updated code as below



    Please Login or Register  to view this content.
    Thanks & Regards,
    Vidhya
    Last edited by vidhyakrr; 05-01-2016 at 08:19 PM.

  3. #3
    Registered User
    Join Date
    11-16-2016
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    7

    Re: open , save & close multiple hyperlinks VBA

    Thanks Vidhyakrr, this helped me much.
    I've had the same problem.

    in my colums are all the hyperlinks of the workbook, but not in each row is a Hyperlink...
    in some rows is the same hyperlink as before...

    is it possible to open each "different" hyperlink only once?

    This is my code:

    Private Sub test_Click()
    Range("D6:D356").Select
    For Each Cell In Selection
    Cell.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    Application.Wait (Now + TimeValue("00:00:02"))
    ActiveWorkbook.Save
    ActiveWindow.Close
    Next Cell

    End Sub

    the loop, doesn't work, either. It debugs at the red-highlited line.
    Can someone help me with this?

    Thanks
    Chris_Chui
    Last edited by Chris_Chui; 11-17-2016 at 10:32 AM.

  4. #4
    Registered User
    Join Date
    11-16-2016
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    7

    Re: open , save & close multiple hyperlinks VBA

    Hi all,

    anybody an idea?
    Hopefully...cause I'll need to solve the problem within the next week.

    Thanks so much
    Chris_Chui

+ 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. VBA CODE - open save hyperlinks
    By bkay25 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-29-2016, 10:42 AM
  2. Open, Run, Save and Close
    By fred3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2014, 01:13 PM
  3. Save As but keep active wb open but the Save As .close
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2014, 01:45 PM
  4. Open Multiple Files to Update - Close & Save with One click
    By awaken88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2012, 05:24 PM
  5. Replies: 1
    Last Post: 04-19-2012, 07:59 PM
  6. Save and Close Open File
    By cmcgath in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-17-2010, 10:35 AM
  7. Hyperlinks to files open and then close instantaneously
    By Rford626 in forum Excel General
    Replies: 0
    Last Post: 03-06-2006, 06:35 PM

Tags for this Thread

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