What is the FileType number for PDF in Excel 2007 that is needed to save a file as PDF through the API?

前端 未结 2 953
时光取名叫无心
时光取名叫无心 2020-12-21 16:44

I need to call a function in order to save an Excel workbook. I installed the PDF save addon for Excel 2007 but now I need to know what the number code is for the file forma

相关标签:
2条回答
  • 2020-12-21 17:15

    Check out the Workbook.ExportAsFixedFormat method:

    ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF 
        FileName:=“sales.pdf” 
        Quality:=xlQualityStandard 
        DisplayFileAfterPublish:=True 
    

    This method should be preferred over using SaveAs because it also allows specifying all PDF / XPS options.

    Note: This method has been added to the Excel object model with Excel 2007 and requires the Save as PDF or XPS Add-in for 2007 Microsoft Office programs to be installed.

    0 讨论(0)
  • 2020-12-21 17:31

    I did this in Word, and the format number is 17.

    0 讨论(0)
提交回复
热议问题