Hi all,
Need assistance
I need to download the embedded pdf documents from excel and save in the drive. And if it is successful run then results/error should be get in UiPath and use it as exception handling.
Please suggest on this
Hi all,
Need assistance
I need to download the embedded pdf documents from excel and save in the drive. And if it is successful run then results/error should be get in UiPath and use it as exception handling.
Please suggest on this
You need to go with macro and use on error and goto for error handling and returning the status to UiPath
Cheers
Do you have any example on the same
this is a gpt generated code…you can try thsi and modify or even record a macro in excel
Sub SaveEmbeddedPDFAsFile()
Dim ws As Worksheet
Dim oleObj As OLEObject
Dim embeddedPDF As Object
Dim filePath As String
Dim fileName As String
' Set the worksheet containing the embedded PDF
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your sheet name
' Loop through the OLEObjects in the worksheet
For Each oleObj In ws.OLEObjects
' Check if the OLEObject is a PDF (Acrobat Document)
If oleObj.ProgID = "AcroExch.Document.7" Then
' Set the embedded object
Set embeddedPDF = oleObj.Object
' Define the save path and file name
fileName = "EmbeddedPDF.pdf" ' Change the file name if needed
filePath = ThisWorkbook.Path & "\" & fileName
' Save the embedded PDF as a separate file
embeddedPDF.SaveAs filePath
MsgBox "PDF saved as " & filePath
Exit Sub ' Exit after saving the first found PDF
End If
Next oleObj
MsgBox "No PDF found in the worksheet."
End Sub
cheers
I tried using chat gpt related all examples… it doesn’t work