How to convert Excel and PDF files to each other.(Power Automate Desktop)

Japanese version.

This section shows how to convert Excel files and PDF files to each other.

Conversion from Excel file to PDF file.

Put in place "Run VBScript".

Specify the following code in the "VBScript to run" parameter.

Dim xls, book, sheet, sheetName, srcFile, dstFile

' Specify the source Excel file to be converted.
srcFile = "C:\Test\Test.xlsx"

' Specify the name of the sheet to be converted.
sheetName = "Sheet1"

' Specify the converted PDF file.
dstFile = "C:\Test\Test.pdf"

Set xls = CreateObject("Excel.Application")
Set book = xls.Workbooks.open(srcFile)

Set sheet = xls.Sheets(sheetName)
sheet.Activate

xls.ActiveSheet.ExportAsFixedFormat 0,dstFile,0,1,0,,,0

book.Close
xls.Quit

This action will convert an Excel file to a PDF file.

Conversion from PDF file to Excel file.

Get text information in PDF with "Extract text from PDF".
Or "Extract tables from PDF" to retrieve tables in the PDF.
Then write the variables produced to an Excel file with "Write to Excel worksheet".

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Tips(Power Automate Desktop)