parentright.blogg.se

Cutepdf writer on cpw2
Cutepdf writer on cpw2





cutepdf writer on cpw2
  1. Cutepdf writer on cpw2 how to#
  2. Cutepdf writer on cpw2 pdf#
  3. Cutepdf writer on cpw2 code#

> oExcel.ExecuteExcel4Macro( "PRINT(1,1,1,TRUE,FALSE)")

Cutepdf writer on cpw2 pdf#

> When I can get the printer to change to the Cute PDF writer (not always), the following does command Excel to print: Application.ActivePrinter = "CutePDF Writer on CPW2:" > oExcel = Createobject( "Excel.Application") I want to be able to specify the filename, but cannot achieve either at this point: > I am trying to set CutePDF Writer as the default printer, then print to PDF.

cutepdf writer on cpw2

"to view the pdf-file you selected.That great so far, do you know how I can automate the filename? "Rightclick the file you want and use 'open with. MsgBox "You can't open pdf files with this function." & vbCrLf & _ lpstrTitle = "Display PDF's in Workbook Directory. Private Declare Function GetOpenFileName Lib "comdlg32.dll" _ Moala and modified (5 %) by me.Option Explicit Workbook must first be saved once to have the result, apart from the printing to my colour printerĪlternate routine (and much quicker altough it was not originally created for this) originally from Ivan F. Something I missed there? The file 'consolidate.pdf' is saved in the same directory as the workbook. There is something else I dont get, unrelated to the code: if I print to pdf manually, it does the whole printing thing along with a filename dialogue, but no location dialogue ( and I can't find the files it has supposedly made. If it is pdfcreator change PDFcreator with your name How do Icheck the printer name? ( i looked in printers and faxes, but the name there is just pdfcreator) and probably more importantly how do I fit it in the code. The running tasks in memory may not have any occurances of pdfcreator. Have you removed all running instances of pdfcreator from memory. (strrrrrange.)Īfter I changed the default printer to the pdfcreator to see what would happen i just get the error message "cant initialise pdfcreator" apparantly, thepdf printer name i entered wasn't right yet. Įnd one step closer: I added the code, but instead of printing to the pdf creator it printed to my default printer. 'Could be anything : PDF on server01 or PDFCreator on Network. 'The text marked as red in line above is the name of your printer Sheets(lSheet).Name = "Signatures and pricing" Then If Sheets(lSheet).Name = "Information" Or _ 'Adapted by Charlize for printing certain worksheets () File will be saved to 'Consolidated'.Sub PrintToPDF_MultiSheetToOne_Early() But you must be sure of the name of the printer. If Not IsEmpty(Application.Sheets(lSheet).UsedRange) And _Īpplication.Sheets(lSheet).Name = "Information" Or _Īpplication.Sheets(lSheet).Name = "IPL Service" Or _Īpplication.Sheets(lSheet).Name = "Signatures and pricing" Thenįinal attempt. 'added this for the sheetnames that you want to include

cutepdf writer on cpw2

Not tested but you could try this one.Sub PrintToPDF_MultiSheetToOne_Early() 'Wait until PDF creator is finished then release the objects 'Combine all PDFs into a single file and stop the printer 'Wait until all print jobs have entered the print queueĭo Until pdfjob.cCountOfPrintjobs = lTtlSheets If Not IsEmpty(Application.Sheets(lSheet).UsedRange) ThenĪpplication.Sheets(lSheet).PrintOut copies:=1, ActivePrinter:="PDFCreator" On Error Resume Next 'To deal with chart sheets MsgBox "Can't initialize PDFCreator.", vbCritical + _įor lSheet = 1 To If pdfjob.cStart("/NoProcessingAtStartup") = False Then Set pdfjob = New PDFCreator.clsPDFCreator SPDFPath = ActiveWorkbook.Path & Application.PathSeparator '/// Change the output file name here! ///

cutepdf writer on cpw2

' Designed for early bind, set reference to PDFCreator 'Macro Purpose: Print to PDF file using PDFCreator Where do I enter the sheet names it has to print, and how do I link it to a button (when I tried that i got an internal error).Ĭan anyone help with this? (you'll have my eternal gratitude if that's any incentive :biggrin: )

Cutepdf writer on cpw2 how to#

What I can't figure out is how to use the code: What I want to happen is the first 3 sheets ( by name "Information", "IPL Service" and "Signatures and pricing") to be printed in a single PDF file.

Cutepdf writer on cpw2 code#

Go to www dot excelguru dot ca slash node slash 21 ]īut since I know next to nothing about vba, I can't understand the code well enough to alter it to work on my workbook.5993 [I can't post links yet, so i'll do this the convoluted way: I found on his site an article on how to print multiple sheets to a singe pdf which is exactly what I need for a project i'm doing. I got redirected by Ken Pulse to this site for a specific question I have.







Cutepdf writer on cpw2