Excel - export large document to pdf result in crash

I’m trying to export a large excel to PDF. The PDF result in a document consisting of more than 8000 pages.

When the robot push the publish button it start to create the document and the robot immediately stops with error.

I have tried to put the WaitForReady to complete and TimeoutMS to 500000.

I solved this by creating a while loop that looks for the PDF document to be open.