In general, always qualify your references. Step 5: Choose a file name for the output PDF file. Step 4: Then choose the destination folder to save the output file. A powerful application that allows you to create professional-quality PDF files from printed documents. Step 2: Select ‘CutePDF Writer’ from the ‘Printer’ dropbox. But if not, your Sheets.Count may return something different than ThisWorkbook.Sheets(i).Name expects. Step 1: In the application, click on the ‘File’ menu and select the ‘Print’ option. As long as ThisWorkbook is active, you're fine. SNarray(lCnt) = ThisWorkbook.Sheets(i).Nameįinally, when you use Sheets without specifying the workbook, you are actually using ActiveWorkbook.Sheets if you're in a standard module and ThisWorkbook.Sheets if you're in the ThisWorkbook module. ThisWorkbook.Sheets(i).Visible = xlSheetVisible Then Cons: It takes a long time to print and combine documents via cutepdf. If ThisWorkbook.Sheets(i).Type = xlWorksheet And _ Is CutePDF the right PDF solution for your business Get opinions from real users. Also, if someone adds a chart sheet or macro sheet and you would want to skip that, you might want to code for that. That's not what you're getting now, but if there is any chance a sheet may be hidden, you might want to code for it. Make sure that all of your sheets are visible or you'll get Select method of Sheets class failed error. Remove the parentheses from your array in your select statement Sheets(SNarray).Select
0 Comments
Leave a Reply. |