VBA Code to Create PDF Thumbnails?

Billy Hill

Board Regular
Joined
Dec 21, 2010
Messages
73
My work laptop has been replaced with a machine with Windows Vista. One of my macros grabs a bunch of links to PDF files from our server and copies them to a folder and opens the folder with big thumbnails. The thumbnails on Vista don't get created like they used to and I've heard Adobe has not desire to do anything about it. The entire reason I created the macro is so I could quickly scan through the thumbnails in Windows Explorer and perhaps put them in an email or open them or whatever. Is there any way I can generate thumbnails each time I populate the folder? Thanks!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
The code in #24 works correctly in my testing. It creates a rectangle shape (ActiveSheet.OLEObjects.Add).

What piece of code (please provide it in its whole) is NOT working as it should? What are the prerequisites to have before executing (what rectangle shape name, and so on). Then I'll be happy to test again.

oops.:laugh:

Code:
MsgBox ActiveSheet.Shapes("Rounded Rectangle 1").Width
MsgBox ActiveSheet.Shapes("IncomingInvoice").Width

Hrm....it shows the width of the PDf as 142.5
and the width of the rectangle as 260.3999

does it matter where in the sub that I set the width of the PDF maybe? But again...why does it fix itself after I do it the second time?
 
Upvote 0
OK So I put the width and height lines like this:
Code:
                    .Height = ActiveSheet.Shapes("Rounded Rectangle 1").Height
                    .Width = ActiveSheet.Shapes("Rounded Rectangle 1").Width

And now the Height is too short, and the width is fine....
I'm confused.
 
Upvote 0
Just curious, I tested your code with:
1. Standard Module Macro.
2. ActiveX Button Click event.
3. Form Control Button Click event
And in all of the cases it resizes to the textbox size.

It does not help, but here are my suggestions:
1. Remove 'On Error Resume Next' part during testing and let us see if that pops an error message which we might be 'failing' to notice.
2. Test it at some other Computer if thats possible (as it worked fine here!) to confirm its NOT a Computer issue.
 
Upvote 0
Sent, and Thanks. Took me a minute to figure out that email.

I received the email, but have not yet found the time to test further. Now it's late too (2AM) so it will be for tomorrow :-)
 
Upvote 0
I received the email, but have not yet found the time to test further. Now it's late too (2AM) so it will be for tomorrow :-)

I opened the file, click the button, browse to a random PDF file, and it is shown within the rectangle, with correct height and width. Sorry but I cannot reproduce the problem.
 
Upvote 0
I have come to the conclusion that it is my computer which is causing the error. Could it be because I am using two screens? My laptop works perfectly for it. I don't know.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,253
Members
452,900
Latest member
LisaGo

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