Export Document stuck in loop?

OpenRPA version: 1.4.57
Error message: none

error1


Hi,
i have a problem where my Bots where stuck in infinite processing of an workitem and after some research it seems that they are stuck on an export document activity, that neither timeouts nor finishes.

In the screenshots you can see that the workflow “process” called by “main” is still running and the logs show that the last write line was “After Word”.
“Before Mail” never gets put out and i highly doubt it is stuck on the assign.

Greetings Marvin

I have 4 bots now stuck at the exact same spot. So this isn’t just a fluke.

Export Workbook and Export Document simply call SaveAs on the office object. I don’t see what I can do to “fix” this. Maybe check if there is a dialog from Excel/Word in the background stopping it from saving? Test manually to save as PDF on one of the documents it failed on?

I changed to programmatically creating the pdf instead and it never stopped since, so definitely something weird going on with that activity, absolutely not reliant on the activity so for me this is not a big problem, now that i know. But i at least thought i report it so people running into the same problem know what’s going on.

Mind sharing your code ? So I can compare with my version ?

I truncated a lot of word document building where is replace words and build tables and such:

Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Microsoft.Office.Interop.Word.Document document = wordApp.Documents.Open(confirmationPath);

//HERE HAPPENS A LOT OF FIND OBJECT STUFF

document.ExportAsFixedFormat(confirmationPDFPath, WdExportFormat.wdExportFormatPDF);
document.Close(Microsoft.Office.Interop.Word.WdSaveOptions.wdSaveChanges);
wordApp.Quit();

Thinking about it the problem might have been that i did all of the stuff above except the export and right after called the activity, maybe word wasn’t ready yet or something.

Still i think the activity needs some sort of timeout then being stuff in processing forever is not a desired state.

That is so odd, your arguments are “flipped” compared to mine?

if (formattype == "1")
{
   workbook.ExportAsFixedFormat(XlFixedFormatType.xlTypeXPS, filename);
}
else
{
   workbook.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, filename);
}

(I need to learn C# again. When I looked at the code before, I just assumed it was the SaveAs, but now I see that I also use ExportAsFixedFormat. The SaveAs part is called before the export, which happens when you set SaveChanges to true)

You are using the Excel Export and i am using the Word Export is the difference i see. Not that this should be the source of the issue so.

That also explains why for no reason excel was opening when i used the activity when all i was doing was working on a word document.

your right, i was lookin in export workbook, i failed to see, you were working with word.
I have the same arguments as you in export document.

if (formattype == "1")
{
   document.ExportAsFixedFormat(filename, WdExportFormat.wdExportFormatXPS);
}
else
{
   document.ExportAsFixedFormat(filename, WdExportFormat.wdExportFormatPDF);
}

Yea as i said i cant see anything wrong with your code.
The fact still stands that no matter the reason of the error, there should be some sort of global timeout for any OpenRPA process stuck.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.