One basic use is to print the selected range by just clicking on one button. If you want to open the file after creating using excel, set it True. I set it false because I create 100s of files using a loop, and I don't want them to open. It means that the file you create will not open automatically. It means it will ignore any print area already set.įinally, we set OpenAfterPublish as False. Then we set the IgnorePrintAreas as True. It means that the resultant PDF will have the properties of a Document. Next, we set the IncludeDocProperties as True. We have another choice as xlQualityMinimum. Next, we set the quality of the pdfile as xlQualityStandard. You can write a hardcoded text here or customize it as per your need. We set the Filename as pdfile, which contains the string of the fully qualified name of the pdf file. Another choice is xlTypeXPS, which will save the selected range as XPS file. invoiceRng.ExportAsFixedFormat _įinally, we use the ExpoortAsFixedFormat method of Range class to print the defined Excel range as PDF. As a result, pdfile contains the fully qualified name of the resultant pdf file. In the above two lines, we first name the file with a timestamp and then add to the path of the main file. pdfile = "invoice"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |