Hi,
Hope some can help me.
I have a list of file locations of .pdf files in column A of my spreadsheet. All the path and files have info on Sheet1.
i.e. Column A1 c:testpacking_1.pdf A2 c:testcountry_1.pdf
Can I use VBA to, when I run it, print all of the files in the list in column A1 to D20 ?
Thanks in advance.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Print External PDF Files from Excel Sheet
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Print External PDF Files from Excel Sheet
- This topic has 59 replies, 22 voices, and was last updated 6 years, 2 months ago.
AuthorTopicWSfoncesa
AskWoody LoungerAugust 26, 2013 at 11:12 pm #490730Viewing 10 reply threadsAuthorReplies-
zeddy
AskWoody_MVPAugust 27, 2013 at 6:08 am #1409211Hi foncesa
Welcome to the Lounge!
Yes, you can use vba to do what you want. Probably.
I tried this code on my laptop, and it printed my test pdf files to my default printer.
It uses the Adobe Reader to do the printing:Code:Sub printPDFfiles() 'ChDrive "E" '<< if your files are on a different drive! 'NOTE:Example below uses Adobe Reader, but apply to Acrobat as well. 'If you are using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe 'on the command line. 'NOTE: '/s=don't show splash screen '/n=new instance '/h=minimised window '/t=print to default printer; or use /t 'CHECK YOUR ADOBE READER VERSION, AND USE CORRECT PATH.. 'zProg = "C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe" zProg = "C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe" zLastRow = [a65536].End(xlUp).Row 'find last row in column [A]; e.g. 15 temp = "a1:a" & zLastRow 'e.g. "a1:a15" '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For Each cell In Range(temp) 'loop through all entries in range zFile = cell.Value 'fetch filename from cell If zFile Like "*.pdf" Then 'check it is a pdf file type Shell (zProg & " /n /h /t " & zFile) 'execute command to print the pdf document End If 'end of test for pdf file type Next 'process nect file in list '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Sub
Note that after printing all the files, it leaves the Adobe Reader open.
I don’t know how to close it.
Perhaps someone here can tell us that bit.
Meanwhile, you can close the Adobe session manually.Hope this helps.
I have attached a sample file containing this code.Let me know if this works for you.
zeddy
-
WSfoncesa
AskWoody LoungerAugust 28, 2013 at 1:42 pm #1409362Let me know if this works for you.
zeddy
Thanks zeddy for reply, I tried on network printer but was unsuccessful to print, I have Windows 7, Office 2013.
Then i tried to test it from the command prompt “C:Program FilesAdobeReader 11.0ReaderAcroRd32.exe” / n/ h/ t “C:1.pdf” “HP LaserJet Professional M1213nf MFP” and it printed the document.
The printer is HP LaserJet Professional M1213nf MFP with IP_192.168.1.40
Does it require to add any references in VBA Editor.
Please help to sort it, Thanks in advance. -
zeddy
AskWoody_MVPAugust 28, 2013 at 2:47 pm #1409369 -
WSfoncesa
AskWoody LoungerAugust 31, 2013 at 6:10 pm #1409648Hi Zeddy,
I tried & finally with this [ Shell “””” & zProg & “””/n /t “”” & zFile & “””” ] i got the success, Credit goes to you. Thankyou.
I want to trouble you, Is there any way to have a popup asking which printer do you want to print, we have 2 printers on network.Once again thanks a lot.
-
zeddy
AskWoody_MVPSeptember 1, 2013 at 3:28 pm #1409751Hi foncesa
In my previous attached file rz2-print-pdf-files.xlsm I think I should have left a space between the filename and printername in the Shell command.
see attached new file.Note: When you use the Shell command, you can either use it like this with brackets Shell (xxx)
e.g.
Shell (command)
..or like this
Shell (zProg & ” /n /h /t ” & zFile)
or like this without brackets Shell “command”
..so that is why you had to use the double sets of quotes etc etc.If you let me know the name of your second network printer, I could give another update.
zeddy
-
WSfoncesa
AskWoody Lounger -
zeddy
AskWoody_MVPSeptember 3, 2013 at 8:19 am #1410017Hi foncesa
See attached file.
This file, when opened with macros enabled, will put the name of your default Excel printer into a named cell [chosenPrinter]
This is always done on startup, via the Workbook_Open event.The default Excel printer may vary, depending on what computer you are on.
The names of available printers will also vary, depending on what network computer you are on.A Printer Selection button has been provided, which will allow you to select from the available printers for that computer.
The selected printer name will be placed in the named cell [chosenPrinter]A button has been provided to start printing the pdf files listed in column [A]
A message box is displayed telling you how many files will be printed, and what printer will be used.
You can cancel this, and change the required Printer if you want to.I have modifed the code to allow for any spaces in the folder names for the pdf files.
(For example, C:My DocumentsMy foldersample1.pdf)
The folders containing the pdf files are assumed to be on drive C:Please let me know if this works.
zeddy
-
WSfoncesa
AskWoody LoungerSeptember 4, 2013 at 3:37 pm #1410244Thanks Zeddy, I appreciate your efforts for me, Thanks a lot.
A small request to you, I have lots of printing and if send all of them to printer in one shot as the script does the printers stops printing because of lots of job or the job is lost over network. I want an pause of 2 minutes after 5 rows of column A, and continue for next 5 then pause to continue till end.With folded hands thankyou very much.
-
zeddy
AskWoody_MVP -
zeddy
AskWoody_MVPSeptember 8, 2013 at 4:04 am #1410752Hi foncesa
..I see there hasn’t been any other replies.
So, in the attached file, I have added a two-minute pause after every five pdf files have been sent to the printer.
I also included a progress message (in the bottom statusbar) and a completion message when finished.Please let me know if this works OK.
zeddy
-
WSketanvp87
AskWoody LoungerJuly 17, 2016 at 3:42 am #1570542Hi foncesa
..I see there hasn’t been any other replies.
So, in the attached file, I have added a two-minute pause after every five pdf files have been sent to the printer.
I also included a progress message (in the bottom statusbar) and a completion message when finished.Please let me know if this works OK.
zeddy
Hi,
How to enter print Copies no ….???
-
zeddy
AskWoody_MVPJuly 18, 2016 at 2:23 am #1570643Hi
I have attached my latest version of a tool to print pdf documents.
This tool allows you to select a folder for pdf files, or to manually search and choose pdf files for printing.
You can choose which printer to use.
The list of your available printers is generated automatically.
You can choose which printer to use.
You can also look at the vba code if you want to specify a specific network printer on a particular port address.After creating the list of pdf files to print, you can specify how many copies you want to print for each of the pdf files by entering the number required for each pdf print alongside in column .
So if you want 4 copies of a particular pdf, enter 4 in the adjacent cell.
This version attached has some minor updates to the vba coding comments.
zeddy
-
WSd_realtom
AskWoody LoungerDecember 29, 2016 at 12:22 am #1587693Hi
I have attached my latest version of a tool to print pdf documents.
This tool allows you to select a folder for pdf files, or to manually search and choose pdf files for printing.
You can choose which printer to use.
The list of your available printers is generated automatically.
You can choose which printer to use.
You can also look at the vba code if you want to specify a specific network printer on a particular port address.After creating the list of pdf files to print, you can specify how many copies you want to print for each of the pdf files by entering the number required for each pdf print alongside in column .
So if you want 4 copies of a particular pdf, enter 4 in the adjacent cell.
This version attached has some minor updates to the vba coding comments.
zeddy
Hi zeddy,
your file was so helpful, many thanks
I have 2 problem,
1.the pdf file that I would like to print is using A3 paper,
how can I change it to A4 automatically?2.how to close the pdf application automatically after print? or maybe you can make it not to open the pdf application at all before printing
Thank you
-
zeddy
AskWoody_MVPDecember 30, 2016 at 9:36 am #1587749Hi
Welcome to the Lounge as a new poster!
If your pdf document is created as an A3 layout document, (for example it contains spec. drawings of turbo laser canon engines etc etc ) then you can have the printer scale the output to fit on A4 paper. In the file I posted in post#40, click the button in cell [G1] on the [Main] sheet, and then click the [Setup..] button on the displayed Printer Setup dialog. Click the [Effects] tab, and then, in the section labelled Resizing Options click the option button next to Print Document On and then choose your required paper size from the dropdown, and then tick the checkbox option for [ ]Scale to Fit.
Note that if this is a network printer, you may need to have appropriate permissions to change printer settings.I will have a look at closing the pdf application after the final pdf print, and will post back here after I test it.
zeddy
-
WSleetbids
AskWoody LoungerMay 9, 2017 at 3:29 am #1594924Hi Zeddy,
I’m looking for some help to modify your code. Currently I scan a bar code into column G (starting with G2, then G3 and work my way down) In column J the page number of the page I’d like printed from the PDF I have populates. I’d like the code to print the Page number in the last cell of J every time a value is added to G. (I can also work with splitting the PDF into separate documents if this is a must, so then the page number from J would just be the last part of the document name. IE. “Box Label 61” as the document name rather then page 61 of the document “Box Label”) Please let me know If I can explain any parts better.
Thanks
-
WSdamainkilla
AskWoody LoungerDecember 14, 2015 at 1:55 pm #1542026Hi zeddy,
Your code works perfectly as many others have stated. Thanks so much! However I’m trying to print some PDFs with your code in color at my office, and for that to work, normally with adobe reader, after selecting File –> Print and selecting printer’s name, I have to click properties, then a box will pop up. I then have to click quality, uncheck “Print in black and white”. Now with the file you attached here, rz4-print-pdf-files.xlsm, it allows me to select the printer at my office, the same box will pop up when I click set up, but it doesn’t print in color even when I uncheck “Print in black and white”. Any tips on how to fix this?
I’ve also read the comment you made about making a “new printer”. I don’t think I can do that at my office, or even knows how one would achieve such thing. Any help is appreciated.
Thanks zeddy!
Hi foncesa
See attached file.
This file, when opened with macros enabled, will put the name of your default Excel printer into a named cell [chosenPrinter]
This is always done on startup, via the Workbook_Open event.The default Excel printer may vary, depending on what computer you are on.
The names of available printers will also vary, depending on what network computer you are on.A Printer Selection button has been provided, which will allow you to select from the available printers for that computer.
The selected printer name will be placed in the named cell [chosenPrinter]A button has been provided to start printing the pdf files listed in column [A]
A message box is displayed telling you how many files will be printed, and what printer will be used.
You can cancel this, and change the required Printer if you want to.I have modifed the code to allow for any spaces in the folder names for the pdf files.
(For example, C:My DocumentsMy foldersample1.pdf)
The folders containing the pdf files are assumed to be on drive C:Please let me know if this works.
zeddy
-
WSEPecolRO
AskWoody LoungerJanuary 14, 2016 at 2:26 am #1547219Hi there,
If you need to get rid of the residual Adobe Reader window, here’s the code:
Code:‘************************* ‘ KILL Adobe Acrobat Reader… ‘************************* tmpBat = Environ(“Temp”) & Application.PathSeparator & “tmp.Bat” Open tmpBat For Output As #1 Print #1, “@Echo Off” Print #1, “Set ImageName=AcroRd32.Exe” Print #1, “:Loop” Print #1, “TaskList /FI “”ImageName EQ %ImageName%”” | Find /I “”%ImageName%”” > Nul” Print #1, “If Not ErrorLevel 1 (TaskKill /F /IM “”%ImageName%”” > Nul & GoTo :Loop)” Print #1, “Set ImageName=” Close #1 CreateObject(“WScript.Shell”).Run WindowStyle:=0, WaitOnReturn:=True, Command:=tmpBat Kill tmpBat
Eugen
-
WSEPecolRO
AskWoody LoungerJanuary 14, 2016 at 2:49 am #1547221Hi there,
This code finds the Adobe Acrobat Reader’s path (version independent):
Code:‘****************************************** ‘CHECK YOUR ADOBE READER VERSION HERE, ‘AND USE CORRECT PATH… ‘****************************************** zProg = “?” On Error Resume Next zProg = Replace(Replace(CreateObject(“WScript.Shell”).RegRead(“HKEY_CLASSES_ROOTAcroExch.DocumentShellOpenCommand”), ” “”%1″””, “”), “”””, “”) On Error GoTo 0 If zProg = “?” Then MsgBox “Adobe Acrobat Reader was not found !”, vbOKOnly + vbCritical End End If
Eugen
-
WSleighmetcalfe
AskWoody LoungerFebruary 29, 2016 at 5:20 am #1554024Hi I have used the sheet and it works perfectly.
can you tell me why when I paste values I make no other changes on the sheet (b2:B40)
I get a type mismatch error and the VBA highlights the below code
zPrintCopies = Int(cell.Offset(0, 1).Value) ‘fetch number from adjacent cell (on same row)
-
-
-
-
WSwarna
AskWoody LoungerNovember 12, 2014 at 1:05 am #1474940Hi foncesa
Welcome to the Lounge!
Yes, you can use vba to do what you want. Probably.
I tried this code on my laptop, and it printed my test pdf files to my default printer.
It uses the Adobe Reader to do the printing:Code:Sub printPDFfiles() 'ChDrive "E" '<< if your files are on a different drive! 'NOTE:Example below uses Adobe Reader, but apply to Acrobat as well. 'If you are using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe 'on the command line. 'NOTE: '/s=don't show splash screen '/n=new instance '/h=minimised window '/t=print to default printer; or use /t 'CHECK YOUR ADOBE READER VERSION, AND USE CORRECT PATH.. 'zProg = "C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe" zProg = "C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe" zLastRow = [a65536].End(xlUp).Row 'find last row in column [A]; e.g. 15 temp = "a1:a" & zLastRow 'e.g. "a1:a15" '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For Each cell In Range(temp) 'loop through all entries in range zFile = cell.Value 'fetch filename from cell If zFile Like "*.pdf" Then 'check it is a pdf file type Shell (zProg & " /n /h /t " & zFile) 'execute command to print the pdf document End If 'end of test for pdf file type Next 'process nect file in list '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Sub
Note that after printing all the files, it leaves the Adobe Reader open.
I don’t know how to close it.
Perhaps someone here can tell us that bit.
Meanwhile, you can close the Adobe session manually.Hope this helps.
I have attached a sample file containing this code.Let me know if this works for you.
zeddy
Thanks zeddy.
I tested and it does print the file. However it uses the default print settings and I need to use different settings. Normally with adobe once I change the settings for the first file, it then works for all files until adobe is closed and reopened. So I tried printing a file with the settings I want and then using the macro to print a file. However the file printed by the macro still used the default settings. Also after running the macro adobe was set back to the default settings.I tried removing the new instance flag from the macro (/n) but it didn’t make any difference. Is there any way to solve this?
Thanks in advance
-
WSPanyborg
AskWoody LoungerMarch 5, 2015 at 2:49 pm #1493782Hi foncesa
Welcome to the Lounge!
Yes, you can use vba to do what you want. Probably.
I tried this code on my laptop, and it printed my test pdf files to my default printer.
It uses the Adobe Reader to do the printing:Code:Sub printPDFfiles() 'ChDrive "E" '<< if your files are on a different drive! 'NOTE:Example below uses Adobe Reader, but apply to Acrobat as well. 'If you are using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe 'on the command line. 'NOTE: '/s=don't show splash screen '/n=new instance '/h=minimised window '/t=print to default printer; or use /t 'CHECK YOUR ADOBE READER VERSION, AND USE CORRECT PATH.. 'zProg = "C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe" zProg = "C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe" zLastRow = [a65536].End(xlUp).Row 'find last row in column [A]; e.g. 15 temp = "a1:a" & zLastRow 'e.g. "a1:a15" '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For Each cell In Range(temp) 'loop through all entries in range zFile = cell.Value 'fetch filename from cell If zFile Like "*.pdf" Then 'check it is a pdf file type Shell (zProg & " /n /h /t " & zFile) 'execute command to print the pdf document End If 'end of test for pdf file type Next 'process nect file in list '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Sub
Note that after printing all the files, it leaves the Adobe Reader open.
I don’t know how to close it.
Perhaps someone here can tell us that bit.
Meanwhile, you can close the Adobe session manually.Hope this helps.
I have attached a sample file containing this code.Let me know if this works for you.
zeddy
This code worked like a charm for me! Thanx!
But is it possible to add checkboxes so I can choose which files I want to print? I tried to mess around in the code with no luck -
zeddy
AskWoody_MVP -
WSPanyborg
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
-
zeddy
AskWoody_MVPMarch 10, 2015 at 8:03 am #1494375Hi
OK, here’s the latest version of the Excel PDF file printing tool.
Instead of using checkboxes to select which file you want to print, just leave the number of copies you want to print as blank (or zero).I thought this would be a better solution as this allows you (and others who have asked for it) to specify how many copies of each print you want.
I have added the ability to choose a folder, which will list all the pdf files in that folder.
Also, you can add individual pdf files to the list, by browsing and using Ctrl-click to multi-select files.
Please let me know if this works for you.zeddy
-
WSsheiksadak
AskWoody LoungerSeptember 25, 2015 at 9:20 am #1529725Your File is Awesome.
Where to edit the exact printing page number , for example in 1 to 10 page PDF 5 th only i need print.
Where to edit the code which you have given.
Pls revert.
Sheik:rolleyes::rolleyes::rolleyes::rolleyes::rolleyes:
Hi zeddy.
Thanks for the quick reply.
The settings are Quality, Colour & Collation. I think the settings are printer specific but the printer lets me save pre-sets which it then what I select.Thank you
Hi
OK, here’s the latest version of the Excel PDF file printing tool.
Instead of using checkboxes to select which file you want to print, just leave the number of copies you want to print as blank (or zero).I thought this would be a better solution as this allows you (and others who have asked for it) to specify how many copies of each print you want.
I have added the ability to choose a folder, which will list all the pdf files in that folder.
Also, you can add individual pdf files to the list, by browsing and using Ctrl-click to multi-select files.
Please let me know if this works for you.zeddy
-
zeddy
AskWoody_MVP -
WSserious123
AskWoody Lounger -
WSsheiksadak
AskWoody LoungerSeptember 30, 2015 at 3:48 am #1530244Hi Sheik
..do you have Adobe Acrobat? Are you using Word 2013 (or Word 2015)?
(both of these make it easier to print specified pages from a pdf file.)
Please advise.zeddy
i zeddy,
Pdf split i have done through PDF extract tool.
But the printing order in your excel tool is not ascending, it is taking prinout’s in random manner.
I have changed the loop to 10 and the adobe printing taking order is like 3, 5 , 7,1,2 like this….and the loop is changing every time.
the pdfs like 101,102,103,104 and the printing orders like 103, 101, 104,102 like that.
Could you pls specify where we can restrict the order.
Regards
Sheik. -
zeddy
AskWoody_MVP
-
-
-
-
WSmks123seenu
AskWoody LoungerSeptember 25, 2016 at 8:23 am #1579212Hi zeddy
i had tried using same vba code to print multiple pdf file, but i am getting an error – stated below
“there was an error opening this document. this file cannot be found”
C:UsersmseenuDocumentsTAPI INDIAProjectRenaming ToolFile RenamerNew folderIHA01_IHA01.pdf
Appreciate if you or anyone can help me
Thank you
Mohan Seenu -
WSSharyanshgoyal
AskWoody LoungerFebruary 1, 2019 at 12:06 am #1597991Hi
Hope you are doing good!!!can you please help me with the query, i have bill number in excel and the pdf file containing the same bill number in a folder but the folder contain lots of PDF files whether i need only the pdf copies that is matching with the excel file. Is there any code that will automatically fetch the pdf file in a folder matching with the excel file names.
Thanks in advance
Sharyansh
-
-
WSfoncesa
AskWoody Lounger -
zeddy
AskWoody_MVP -
WSwarna
AskWoody Lounger -
zeddy
AskWoody_MVP -
WSCJ5
AskWoody LoungerNovember 20, 2014 at 6:30 pm #1476330I just found this thread and this is almost exactly what I’m trying to do. Zeddy I also really appreciate what you have created, for my purposes (we are printing product manuals daily) we also need to specify a quantity of each PDF to print. For example we have a list of ~20 files, some days we need 0 of a file, some days 5. Is it easy/possible to do this?
-
zeddy
AskWoody_MVPNovember 21, 2014 at 6:18 am #1476369Hi CJ5
Welcome to the Lounge with your first posting.
Yes, it is possible to specify the number of copies of each pdf file to print.
However, Adobe reader doesn’t have a command line switch to allow this (great pity), so we have to use a loop to essentially do the same thing.I have attached an updated file which allows you to specify the required number of copies for each pdf file listed in column [A]. Note, if you leave the required number of copies blank, it will skip that listed pdf file.
Also, to remind you, this attached file needs to be opened with macros enabled. When enabled, it will set the printer to your default printer. There is a button to switch to a different (detected) printer if required. On my system, if I set my printer with paper size, colour, quality etc, these seem to stay in effect for all the printouts.
When finished, the Adobe Reader will still be open, and can be closed manually.
Please let me know if this works for you.zeddy
-
-
-
-
-
WSCJ5
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
WSnickstegmeier
AskWoody LoungerJune 4, 2015 at 5:16 pm #1508060 -
WSrory
AskWoody Lounger -
WSleighmetcalfe
AskWoody Lounger -
zeddy
AskWoody_MVPMarch 3, 2016 at 9:28 am #1554690Hi leigh
..try this:
Replace the vba line:
zPrintCopies = Int(cell.Offset(0, 1).Value) ‘fetch number from adjacent cell (on same row)
with these lines:
zPrintCopies = 0
On Error Resume Next
zPrintCopies = Int(cell.Offset(0, 1)) ‘fetch number from adjacent cell (on same row)
On Error GoTo 0This will treat any ‘text’ entries as zero, but will allow the number of print copies to be entered with a leading apostrophe e.g. as ‘2 etc etc
The Int is required in case someone enters something like 3.65 for the number of copies!zeddy
-
-
-
WSterryyen
AskWoody Lounger -
zeddy
AskWoody_MVPAugust 5, 2016 at 4:38 am #1573451Hi terryyen
Welcome to the Lounge as a new poster!
There are several ways of dealing with this duplex-printing issue.
One is to set up an existing printer (that allows for double-sided printing) using the Advanced Properties for that printer, and then adding that setup as a ‘new’ printer. Then you can select that one for your printouts.zeddy
-
-
WScunado85
AskWoody LoungerFebruary 16, 2017 at 5:42 am #1591207Good Morning All. I know this is an older thread, but I was hoping that someone could help me.
Below is the current code that I am running. Essentially this macro will print external PDF files that are listed in column C.I am having a little trouble taking this to the next step.
Here is what I am looking to do – hopefully someone can help.Column C is the file name. Column b is the quantity. I want to print multiple copies of the file depending on what quantity is listed in column b. I figured the best way to do this is to create a PDF with 50 pages of identical files (as the files are very small in size and the print quantity will next extend past 50) and have a function which prints the number of pages in the PDF that correspond to quantity.
For instance, if column b has a quantity of 20, this macro will print pages 1-20 of the given PDF. The problem is, however, while I imagine this code is quite easy for some of you, it is way above my head!
I would appreciate any help available.
Thank you again!
RyanSub printPDFfiles()
zProg = “C:Program FilesAdobeAcrobat DCAcrobatAcrobat.exe”
zLastRow = [c200].End(xlUp).Row
temp = “c9:c” & zLastRowzPrinter1 = “Afinia L801 Label Printer”
‘~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For Each cell In Range(temp)
zFile = cell.ValueIf zFile Like “*.pdf” Then
Shell (zProg & ” /n /h /t ” & Chr(34) & zFile & Chr(34) & ” ” & zPrinter1)
End IfNext
End Sub -
WScarlrubber
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
WScarlrubber
AskWoody LoungerMarch 12, 2017 at 9:12 am #1593297I have 50 PDFs which is embedded in a worksheet by insert>object (not linked to the file). I can read the PDFs in anywhere. The PDFs are named, for example A1-1, A1-2…to A1-10 and A2-1…to A2-10 and A3-1..to A3-10……A5-1 to A5-10.
Are there any VBA that can let me select some of the PDF to be printed out, let say I type A1 in input box then put all A1 PDFs? -
zeddy
AskWoody_MVPMarch 14, 2017 at 9:38 am #1593441Hi Carl
When you say you have 50 PDFs named A1-1, A1-2,.. are you saying that these are the ‘Object names’ (as per the Excel ‘name-box’ to the left of the top-panel formula bar), or are you saying that these are the actual names of the embedded PDF documents i.e. A1-1.pdf, A1-2.pdf, … etc etc etc.
zeddy
-
WScarlrubber
AskWoody LoungerMarch 14, 2017 at 10:05 am #1593445Hi Carl
When you say you have 50 PDFs named A1-1, A1-2,.. are you saying that these are the ‘Object names’ (as per the Excel ‘name-box’ to the left of the top-panel formula bar), or are you saying that these are the actual names of the embedded PDF documents i.e. A1-1.pdf, A1-2.pdf, … etc etc etc.
zeddy
Per the name box, please help me
-
zeddy
AskWoody_MVP -
WScarlrubber
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
-
-
-
Berton
AskWoody_MVP -
WSSharyanshgoyal
AskWoody Lounger -
Lugh
AskWoody_MVPFebruary 5, 2019 at 5:45 pm #1598022i have posted the same to the form by creating a new thread
New thread here:
How to find out pdf file via using the name from excelLugh.
~
Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD
-
-
Viewing 10 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
7 hours, 26 minutes ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
3 hours, 28 minutes ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
9 hours, 52 minutes ago -
Return of the brain dead FF sidebar
by
EricB
29 minutes ago -
windows settings managed by your organization
by
WSDavidO61
4 hours, 34 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
4 hours, 47 minutes ago -
The local account tax
by
Susan Bradley
37 minutes ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
16 hours, 28 minutes ago -
Digital TV Antenna Recommendation
by
Win7and10
9 hours, 1 minute ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
1 day, 4 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
1 day, 6 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
1 day, 9 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
11 hours, 38 minutes ago -
Steps to take before updating to 24H2
by
Susan Bradley
2 hours, 27 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
16 hours, 4 minutes ago -
Replacing Skype
by
Peter Deegan
4 hours, 37 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 day, 3 hours ago -
Excel Macro — ask for filename to be saved
by
nhsj
34 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
4 hours, 24 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
3 days, 9 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
3 days, 10 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
3 days, 10 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
1 day, 22 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
3 days, 11 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
4 days, 2 hours ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
4 days, 6 hours ago -
Inetpub can be tricked
by
Susan Bradley
2 days, 13 hours ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
3 days ago -
FBI 2024 Internet Crime Report
by
Alex5723
4 days, 9 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 day, 18 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.