Hi
I am developing an Access 2007 application which needs to manipulate an Excel 2007 document. The VBA needs to save an existing Excel doc as a PDF using the Office 2007 Save as PDF add-in which is installed.
So far I have the following code
Dim xlWorkBook As workBook
Dim PDFxlWorkBook As workBook
Set xlWorkBook = Workbooks.Open("J:\Test.xl
s")
xlWorkBook.Application.Dis
playAlerts
= False
xlWorkBook.SaveAs "J:\test.txt"
xlWorkBook.SaveAs "J:\test.csv"
This all works very well and produces the expected results. However when I add the line
xlWorkBook.SaveAs "J:\test.pdf"
The file is generated but obviously it is not a PDF doc just a file with a .pdf extension name thus rendering it unreadable as a PDF.
I have found the following command which will apparently save the Excel doc as a PDF but I cannot get it to work
xlWorkbook.ExportAsFixedFo
rmat(xlTyp
ePDF,"J:\T
est.pdf",x
lQualityMi
nimum)
Any help would be appreciated
Start Free Trial