Is there a way to “save as” a pdf linked by hyperlink in an excel file?
up vote
1
down vote
favorite
I am tasked with downloading hundreds of pdfs that are linked via hyperlink in a giant excel file. As of now, I click the hyperlink, which opens the file in adobe reader in internet explorer, and save the file to a folder on my computer. Is there a way to click the hyperlink within excel and "save as," instead of going through the tedious process of opening and saving each pdf, one by one? I apologize if this question seems a bit stupid or vague, I'm not tech-savvy at all!
microsoft-excel pdf
add a comment |
up vote
1
down vote
favorite
I am tasked with downloading hundreds of pdfs that are linked via hyperlink in a giant excel file. As of now, I click the hyperlink, which opens the file in adobe reader in internet explorer, and save the file to a folder on my computer. Is there a way to click the hyperlink within excel and "save as," instead of going through the tedious process of opening and saving each pdf, one by one? I apologize if this question seems a bit stupid or vague, I'm not tech-savvy at all!
microsoft-excel pdf
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am tasked with downloading hundreds of pdfs that are linked via hyperlink in a giant excel file. As of now, I click the hyperlink, which opens the file in adobe reader in internet explorer, and save the file to a folder on my computer. Is there a way to click the hyperlink within excel and "save as," instead of going through the tedious process of opening and saving each pdf, one by one? I apologize if this question seems a bit stupid or vague, I'm not tech-savvy at all!
microsoft-excel pdf
I am tasked with downloading hundreds of pdfs that are linked via hyperlink in a giant excel file. As of now, I click the hyperlink, which opens the file in adobe reader in internet explorer, and save the file to a folder on my computer. Is there a way to click the hyperlink within excel and "save as," instead of going through the tedious process of opening and saving each pdf, one by one? I apologize if this question seems a bit stupid or vague, I'm not tech-savvy at all!
microsoft-excel pdf
microsoft-excel pdf
asked Jul 23 '14 at 16:37
CTomas
612
612
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
I'll get you part way there. There isn't enough info to do it all but it would be easy to look up the rest.
This uses vba code to do what you requested.
Below is code from vbaexpress written by Mvidas. It takes an internet address and saves it to a local file.
Option Explicit
Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
'Clear memory
Set oXMLHTTP = Nothing
End Function
A macro to test it with
Sub TestingTheCode()
'This will save the Google logo to your hard drive, insert it into the
' active spreadsheet, then delete the local file
SaveWebFile "http://www.google.com/intl/en/images/logo.gif", "C:GoogleLogo.gif"
ActiveSheet.Pictures.Insert "C:GoogleLogo.gif"
Kill "C:GoogleLogo.gif"
End Sub
With this function you need to setup a loop and get the address from your hyperlinks
You would need to setup a loop to go through your cells,Get the hyperlink address and run the function
For i = 1 to lastRow
cellAddress = Replace(Range("A" & i).Hyperlinks(1).Address, "mailto:", "")
'Something to get the file name from the whole file name here
SaveWebFile cellAddress, destinationFolder & filename
Next
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
I'll get you part way there. There isn't enough info to do it all but it would be easy to look up the rest.
This uses vba code to do what you requested.
Below is code from vbaexpress written by Mvidas. It takes an internet address and saves it to a local file.
Option Explicit
Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
'Clear memory
Set oXMLHTTP = Nothing
End Function
A macro to test it with
Sub TestingTheCode()
'This will save the Google logo to your hard drive, insert it into the
' active spreadsheet, then delete the local file
SaveWebFile "http://www.google.com/intl/en/images/logo.gif", "C:GoogleLogo.gif"
ActiveSheet.Pictures.Insert "C:GoogleLogo.gif"
Kill "C:GoogleLogo.gif"
End Sub
With this function you need to setup a loop and get the address from your hyperlinks
You would need to setup a loop to go through your cells,Get the hyperlink address and run the function
For i = 1 to lastRow
cellAddress = Replace(Range("A" & i).Hyperlinks(1).Address, "mailto:", "")
'Something to get the file name from the whole file name here
SaveWebFile cellAddress, destinationFolder & filename
Next
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
add a comment |
up vote
2
down vote
I'll get you part way there. There isn't enough info to do it all but it would be easy to look up the rest.
This uses vba code to do what you requested.
Below is code from vbaexpress written by Mvidas. It takes an internet address and saves it to a local file.
Option Explicit
Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
'Clear memory
Set oXMLHTTP = Nothing
End Function
A macro to test it with
Sub TestingTheCode()
'This will save the Google logo to your hard drive, insert it into the
' active spreadsheet, then delete the local file
SaveWebFile "http://www.google.com/intl/en/images/logo.gif", "C:GoogleLogo.gif"
ActiveSheet.Pictures.Insert "C:GoogleLogo.gif"
Kill "C:GoogleLogo.gif"
End Sub
With this function you need to setup a loop and get the address from your hyperlinks
You would need to setup a loop to go through your cells,Get the hyperlink address and run the function
For i = 1 to lastRow
cellAddress = Replace(Range("A" & i).Hyperlinks(1).Address, "mailto:", "")
'Something to get the file name from the whole file name here
SaveWebFile cellAddress, destinationFolder & filename
Next
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
add a comment |
up vote
2
down vote
up vote
2
down vote
I'll get you part way there. There isn't enough info to do it all but it would be easy to look up the rest.
This uses vba code to do what you requested.
Below is code from vbaexpress written by Mvidas. It takes an internet address and saves it to a local file.
Option Explicit
Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
'Clear memory
Set oXMLHTTP = Nothing
End Function
A macro to test it with
Sub TestingTheCode()
'This will save the Google logo to your hard drive, insert it into the
' active spreadsheet, then delete the local file
SaveWebFile "http://www.google.com/intl/en/images/logo.gif", "C:GoogleLogo.gif"
ActiveSheet.Pictures.Insert "C:GoogleLogo.gif"
Kill "C:GoogleLogo.gif"
End Sub
With this function you need to setup a loop and get the address from your hyperlinks
You would need to setup a loop to go through your cells,Get the hyperlink address and run the function
For i = 1 to lastRow
cellAddress = Replace(Range("A" & i).Hyperlinks(1).Address, "mailto:", "")
'Something to get the file name from the whole file name here
SaveWebFile cellAddress, destinationFolder & filename
Next
I'll get you part way there. There isn't enough info to do it all but it would be easy to look up the rest.
This uses vba code to do what you requested.
Below is code from vbaexpress written by Mvidas. It takes an internet address and saves it to a local file.
Option Explicit
Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
'Clear memory
Set oXMLHTTP = Nothing
End Function
A macro to test it with
Sub TestingTheCode()
'This will save the Google logo to your hard drive, insert it into the
' active spreadsheet, then delete the local file
SaveWebFile "http://www.google.com/intl/en/images/logo.gif", "C:GoogleLogo.gif"
ActiveSheet.Pictures.Insert "C:GoogleLogo.gif"
Kill "C:GoogleLogo.gif"
End Sub
With this function you need to setup a loop and get the address from your hyperlinks
You would need to setup a loop to go through your cells,Get the hyperlink address and run the function
For i = 1 to lastRow
cellAddress = Replace(Range("A" & i).Hyperlinks(1).Address, "mailto:", "")
'Something to get the file name from the whole file name here
SaveWebFile cellAddress, destinationFolder & filename
Next
edited Jul 23 '14 at 19:57
answered Jul 23 '14 at 19:46
gtwebb
2,7571613
2,7571613
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
add a comment |
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
Nice answer. Can the target web address be modified to permit login information or do the objects used in the main working function not permit this?
– EngBIRD
May 28 '15 at 2:40
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f787007%2fis-there-a-way-to-save-as-a-pdf-linked-by-hyperlink-in-an-excel-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown