简体   繁体   中英

export access to excel as pdf

I have vba set up to export data from access to excel, this works very well. I would like to have the excel file converted to a pdf. Can I do this via vba on the access side? It would have to be after excel is populated with the data, I don't need to save the file, just display it. It will be printed. I don't want the end user to have to convert it to a pdf.

I can post the code if need be.

D

Either do a 2nd export to PDF (and make it open automatically right after) or use the reporting functionality built in Access itself.

If you choose this last option, use as the record source the information you're already using for your Excel file, and make your report open with the Pop Up option enabled. As the Default View, choose the "Report View.

It will be something like this:

DoCmd.OpenReport "Record source", acViewReport, , , acDialog

Replace your "Record Source" with the table/Query containing the information.

Please note that the AcDialog option will retain both Pop Up and Modal properties so the report window will keep focus until you close it.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM