Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

How to save a EXCEL as PDF by ole coding?

$
0
0

Experts,

 

Yesterday I tried to save a file.xlsx as file.pdf by ole coding and failed,

 

then i did the same thing on file.docx and succeeded.

 

So i 'm confused now and hope to make it clear whether it's possible to save a EXCEL as PDF by ole coding....

 

Below is my test coding of saving file.docx.

 

Any help will be appreciated *_*.

 

CREATE OBJECT lv_wordapp 'word.application'.
SET PROPERTY OF lv_wordapp 'Visible' = 0.
CALL METHOD OF lv_wordapp 'Documents' = lv_worddoc.
CALL METHOD OF lv_worddoc 'Open'  EXPORTING    #1 = 'C:\Users\Administrator\Desktop\test.docx'.
CALL METHOD OF lv_wordapp 'ActiveDocument' = lv_wordadoc.
CALL METHOD OF lv_wordadoc 'Content' = lv_wordcont.
CALL METHOD OF lv_wordadoc 'SaveAs'  EXPORTING    #1 = 'C:\Users\Administrator\Desktop\test.pdf'    #2 = 17. "save as a PDF file
CALL METHOD OF lv_wordapp 'Quit'.
FREE OBJECT lv_wordapp .

Best Regards

Panda


Viewing all articles
Browse latest Browse all 9052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>