Print to Adobe PDF

AAAAndy

New Member
Joined
Feb 1, 2010
Messages
27
I have a list of names, and currently I enter each name one at a time into a report and print that report. I need the macro to cycle through all the names in the list, and print the report for that name. I have to print to Adobe PDF.

Can I write a macro to print from an Excel (2007) worksheet as an Adobe PDF? I would generate the file name in the worksheet and then save the PDF with that name. Then I need Adobe to close that PDF file - it need not close the Adobe application.

Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Not sure what you mean by
Code:
I have to print to Adobe PDF
and mentioning closing Abobe.

Does 2007 not have a "Save as PDF" option ? I see this is appearing in all sorts of applications nowadays.

There are nowadays several applications, some free, that disguise themselves as a printer and are used as such. They usually prompt for a pdf filename - which might be a problem when using VBA

I used a free one called PDF995 for some years, but seem to have picked up a couple more which have installed via other applications I use - and don't have the advertising (which is not a problem).

I think 'PDF Create' from Nuance was free with Omnipage or Paperport. I have both.This installs a printer driver as described as well as adding toolbar buttons to Office applications.

I must have got 'Docucom PDF driver' free with something. I see it is free 30 day trial & $49 to buy.

Hope this helps. Basic code below
Code:
'=============================================================================
'- PRINT WORKSHEET USING LIST OF NAMES
'- assumes the list is in column A, row 2 down.
'- this is just an outline
'- not doing anything with the actual name
'=============================================================================
Sub test()
    Dim LastRow As Long
    Dim MyName As String
    '-------------------------------------------
    LastRow = Range("A65536").End(xlUp).Row
    For r = 2 To LastRow
        MyName = ActiveSheet.Cells(r, 1).Value
        Worksheets("something").PrintOut
    Next
    '-------------------------------------------
End Sub

If you do not receive a reply to your message after a couple of days you can reply to your own message (some just put "bump") to bring it to the top again.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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