3th try please help anyone?

thommienl

New Member
Joined
Jun 20, 2013
Messages
15
This is my 3th post and so far i have not yet received any reply.
:( Can someone please try to help/assist me with the below question?

In row A i got all kind of hyperlinks to PDF files stored on my PC. Is it possible to select several of these hyperlinks of my choosing,
and then save the selected hyperlinks to these PDF files to a folder of my own choosing? The idea is to end up with an folder with the selected PDF's so not the hyperlink should be saved in the folder but the PDF file which the hyperlink points at.

Thank you?:confused:
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Opne up the VBE (Alt+F11) and go Insert>Module in the Menu bar in the VBE. Paste the following in to the module that will appear:

Code:
Sub SaveDownHyperlink()
Dim strFolder As String
Dim strFiles As String
Dim cell As Range
Dim arrFiles As Variant, itm As Variant


For Each cell In Selection
    Debug.Print cell.Address
    If cell.Hyperlinks.Count Then
        strFiles = "," & cell.Hyperlinks(1).Address & strFiles
    End If
Next cell

If Len(strFiles) > 0 Then
    arrFiles = Split(Mid(strFiles, 2), ",")
    With Application.FileDialog(msoFileDialogFolderPicker)
        .InitialFileName = ActiveWorkbook.Path
        If .Show = -1 Then
            If Len(.SelectedItems(1)) > 0 Then
                strFolder = .SelectedItems(1)
                For Each itm In arrFiles
                    FileCopy itm, strFolder & Mid(itm, InStrRev(itm, "\"))
                Next itm
            Else
                MsgBox "No folder selected"
            End If
        End If
    End With
End If
End Sub

Back in your Excel sheet, make your selection (of your Hyperlinks) and run the macro.
 
Upvote 0
Thank you.

It works when i hyperlink to my own Harddisk, but in my excel i got hyperlinks to a server (Http).
I get the folder to save it in, but once i press ok i get the error code:
Run-time error 5:Invalid Procedure call or argument.

I suspect it has something to do with the server i want to get the PDF file from, since it is working for my own harddisk.

Any ideas?

Appreciate it.
 
Upvote 0
If you select one of these cells with the Hyperlink to the web address, and go Insert>Hyperlink via the ribbon, when the Hyperlinks dialog opens can you copy across the Address that is linked to (not the text that is displayed in the Hyperlink, but the underlying address) into a reply - I want to see what the format is.

There will be options to downloading the file and saving it.

Last question (I think) - is any kind of authentication (eg username/password) required to access the web address?
 
Upvote 0
Dear Firefly,

I have tried and searched for it myself, but i cannot find the solution.

Can you or someone else please help me?

Thank you.
 
Upvote 0
Hey everyone,

Can somebody have a solution? I've got the same problem with error 5 (I am trying to save some .jpg from hyperlinks). Thanks in advance for any help!
 
Upvote 0

Forum statistics

Threads
1,214,559
Messages
6,120,203
Members
448,951
Latest member
jennlynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top