11/22/2023 0 Comments Cutepdf writer on cpw2![]() If pdfjob.cStart("/NoProcessingAtStartup") = False Then Set pdfjob = New PDFCreator.clsPDFCreator SPDFPath = ActiveWorkbook.Path & Application.PathSeparator '/// Change the output file name here! /// ' 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: ) 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. 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. Something I missed there? The file 'consolidate.pdf' is saved in the same directory as the workbook.I got redirected by Ken Pulse to this site for a specific question I have. 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Īpplication.Sheets(lSheet).PrintOut copies:=1, ActivePrinter:=" PDFCreator" ![]() If Sheets(lSheet).Name = "Information" Or _ 'Adapted by Charlize for printing certain worksheets () 'Author : Ken Puls ( 'Macro Purpose: Print to PDF file using PDFCreator 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 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 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 ) 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. I got redirected by Ken Pulse to this site for a specific question I have.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |