Convert Excel to PDF using VBScript
To convert an Excel file to PDF:
Use the Set variable action to create a new variable containing the path of the Excel file you want to convert. In this example, the variable is named ExcelFile.
Use a second Set variable action to create a variable containing the path of the PDF file you want to create. In this example, the variable is named PdfFile.
Deploy the Run VBScript action and populate the following code.
Dim Excel Dim ExcelDoc 'Opens the Excel file' Set Excel = CreateObject("Excel.Application") Set ExcelDoc = Excel.Workbooks.open("%ExcelFile%") 'Creates the pdf file' Excel.ActiveSheet.ExportAsFixedFormat 0, "%PdfFile%" ,0, 1, 0,,,0 'Closes the Excel file' Excel.ActiveWorkbook.Close Excel.Application.Quit
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for