ActivePrinter Property. Office 2003 Returns or sets the name of the active printer. Read/write String. Example. This example displays the name of the active printer. Since Acrobat 7 you do not have to create a Postscript file first, you can. print directly to the Adobe PDF printer and set the output filename (just. 単純にAdobe PDF で印刷処理を. On Error Resume Next For i = 0 To 99 Application.ActivePrinter = c_PDFPrinterName & ' on Ne' & Format(i, '00') & ': ' If Err. Trying to print to PDF, stuck on last step (automatically save as file using. ActivePrinter:='Adobe PDF on Ne04. Printing a PDF file and terminating Adobe Reader. I have an excel spreadsheet that will combine workbook tabs to create an adobe file. The code to set the printer to adobe is Application.Activeprinter.
Application.ActivePrinter = 'Adobe PDF sur Ne09:' MsgBox 'L'imprimante active actuelle devient : ' _ & Chr(10) & ' ==> ' & Application.ActivePrinter ' Print the Excel. Sub Macro2() IF Application.ActivePrinter = 'Adobe PDF on Ne02:' Then Application.ActivePrinter = 'hp LaserJet 1000 on Ne01:' Else Exit Sub End If End.
How to Find the Ne Printer Number in Excel VBA - VBA Visual Basic for Applications (Microsoft) FAQIf you print to a specific printer through vba and refer to the printer via its Ne. For example: If "Adobe PDF on Ne.
Adobe PDF on Ne. 05: ", the code will produce an error. This can happen if new printers are added or if the code is run on multiple computers. The following link contains a function that will identify the Ne.
Copy and paste the code into an excel visual basic module. In the actual macro/code for doing the printing, make the following change: CODEApplication. Active. Printer = "Adobe PDF on Ne. Ne. 0 number it isto.
CODEApplication. Active. Printer = Find. Printer("Adobe PDF") 'or whatever the name of the printer to use as the active printer. You can also use the Find. Printer function from the immediate window as well in order to find out the printer number by providing the name of the printer which can be found in the Devices and Printers section of Control Panel.