PDF Image into Excel

chuchar7

New Member
Joined
May 4, 2012
Messages
2
Hello Excel Gurus,

To start off I am learning macro as I go. But here goes to what I am trying to do for this macro. I have a tab lets say "Sheet1" where there is two columns of data A:B. Column B has hyperlinks to PDF's. Then I have "Sheet2" where I have cell B2 where someone can enter in a value. That value is then vlookup in column A in Sheet1 and the corresponding hyperlink is put into Sheet2 cell B2. What I am then trying to do is take the URL and open it and copy the image on the PDF and pasting it back in cell A4 on Sheet2.

I tried this code, however it does not work, please provide any guidance:

Sub Test()

Dim pic As String
Dim myPicture As Picture

On Error Resume Next

pic = Worksheets("Drawing").Range("C2")

Set myPicture = ActiveSheet.Pictures.Insert(pic)

With myPicture
.ShapeRange.LockAspectRatio = msoFalse
.Width = cl.Width
.Height = cl.Height
.Top = Rows(cl.Row).Top
.Left = Columns(cl.Column).Left
End With

End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I've never tried doing that before, but I think the problem is that a PDF file isn't considered a picture. When working with special syntax like that, I'll turn the macro recorder on and do it manually so see how it's coded. I couldn't get the filepicker to show PDF files. I tried to rename a PDF file as a .jpeg and the Excel import still didn't work.
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,064
Members
448,545
Latest member
kj9

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