Saving Excel as PDF

jonnymop5

Member
Hello,
I'm trying to save excel as a PDF file. Does anyone have any easy guide to follow regarding this issue?

I have tried to follow a few on youtube but running into issues. Any open to walking me through this one?

Thanks,
Jon
 

gil.silva

Active Member
Hello,

Duplicate one action from the Excel VBO, for instance, the Rename worksheet.
Keep the initialize of variables and ws and add:

Code:
ws.ExportAsFixedFormat(0, Destination)

Destination should be your input variable with the path + filename.pdf
 

LearningRPA

New Member
Here is the code snippet for saving Excel to pDF

Dim wb as Object = GetWorkbook(Handle,Workbookname)
Dim excel as Object = wb.Application
wb.ExportAsFixedFormat (Type:=0, Filename:=PDFPath, Quality:=0, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False)
wb = Nothing
 
Top