If you choose CutePDF (or whatever you named it) you should be prompted with a dialogue box asking where you’d like to save the PDF. On the Ports tab, change the port to CPW2: (CutePDF Writer).You can change the name in the first text box to CutePDF or similar so it’s easier to find and remember.Go back to Devices and Printers and right click on the printer you just selected and choose Printer Properties.Now, I want to select all sheets and to print as a single file, as the same with. Continue on with the install and finally add the printer ExportAsFixedFormat from this topic, but unfortunately, Printed PDF had some issues about formatting and some symbols.You may have to look in the list, but there should be plenty of PostScript compatible HP drivers you can pick from. The PS at the end represents that it is a PostScript driver. I went to the HP drivers and selected the HP Color LaserJet 2500 PS driver. For driver you’ll need to find a PostScript compatible driver.I went ahead and selected LPT1: (Printer Port).Make sure the drop down has an option for CPW2: (CutePDF Writer) otherwise these steps will not work.Go to Devices and Printers and select Add a Printer.Make sure you select to install the PS2PDF tool when it asks. Install CutePDF Writer and allow it to error out.Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.I’m not completely sure why this error is generated, but I have a hunch it’s because CutePDF tries to use a list of already installed PostScript print drivers and if none of the pre-configured ones are found, it errors out and will not continue. Dim Filename As String Filename 'D:\Testdata\Test.pdf' Application. & vbNewLine & "protected workbook/sheet or a sheet/range that not exist" MsgBox "There are problems in one or more files, possible problem:" _ Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ Select a file in any application that prints and open it. ActivePrinter:'CutePDF Writer on CPW2:', Collate:True Next a Sheets('Update').Select Application.ScreenUpdating False End Sub. WebJust click Print and select CutePDF Writer as your printer. ![]() The script does show uninstall prompts to the end-user, but the script automatically transmits the responses. I found this VBS on Reddit, tested it in the K1000 and works like a charm. The trouble is this is printing the 3 worksheets to 3 separate PDFs. With the availability of Microsoft Print to PDF in Windows 10, I imagine others will be removing CutePDF Writer as well. "C:\Documents and Settings\shuerya\Desktop\PDFFiles\" & mybookname & ".pdf", _ I have the following macro to print 3 worksheets to a PDF using CutePDF. 'All PDF Files get saved in the directory below:ĪctiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ Mybookname = Left(mybook.Name, LPosition) LPosition = InStr(1, mybook.Name, ".") - 1 Set mybook = Workbooks.Open(MyPath & MyFiles(Fnum)) Edit: I should probably add that I had none of these issues before Bon. MyPath = "c:\Documents and Settings\shuerya\Desktop\ExcelFiles\"įor Fnum = LBound(MyFiles) To UBound(MyFiles) 'Fill in the path\folder where the Excel files are Sub Convert_Excel_To_PDF()ĭim MyPath As String, FilesInPath As String Hopefully this helps you to convert one or many files, to PDF. It takes all Excel files in a folder, and converts each to a PDF file. Here is some code that I developed a while back. From now on, this path will be used every time you execute the command above. Per GUI you have to enable Use Auto-save and set a auto-save path once. Writer winspool Ne00: CutePDF Writer winspool CPW2: Adobe PDF winspool Ne01: otwww001T01-001-HPLaserJet-4050 winspool Ne02: These printer names were. "Acrobat could not open 'FileName'.pdf because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)." If the output path doesnt matter, you could try PDFCreator with the following commandline: C:Program Files (x86)PDFCreator>PDFCreator.exe /NOSTART /PF'C:test.doc'. This worked well the first few times but now I get the following message whenever I try to open any new file created. MyVal = myLocation & myName & myFileType 'example C:\My Documents\FileName.pdfĪ Copies:=1, Preview:=False, _ĪctivePrinter:="CutePDF Writer on CPW2:", Collate:=True, _ 4.0 3. MyLocation = Sheets("Lists").Range("U2").Value MyName = Sheets("RequestedNursingHomes").Range("A11").Value & " " & Format(Now(), "dd") & Format(Now(), "mm") & Format(Now(), "yyyy") I have file that generates a worksheet based on user selection and then saves the worksheet to a pdf file as followsĭim myName As String, myLocation As String, myFileType As String
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |