Write Cell not Working inside a "Try Catch?!

Hello,

I have a Excel file “Report.xlsx” .
I want to use “Write Cell” to write on cells “E1”, “F1”, “G1” and “H1”.
Inside the “Try Catch”, the “Write Cell” don’t work, don’t throw errors, nothing, it’s like it’s not there…
If I move my “Excel application scope” outside of the “Try Catch”, everything works perfectly.

These are the packages I’m using.

Hi there @Andretgf,
Would you be able to provide an example snippet?

Alternatively, can you provide a screenshot of your Try/Catch, within both the Try and Catch segments?

It is possible you are executing the Try segment, then a failure occurs, gets caught and subsequent actions (such as the Write Cell Activities) are not being performed. You may want to (if you haven’t already) include a Log Message Activity within the Catch, outputting:

  • Exception.Message
  • Exception.Source

If you’ve already done this, please disregard that theory.
Thanks in advance,
Josh

Hello,

When I download the file from SAP, SAP opens the excel file, and I was working with it from there.
Now seems the write lines are working, because I closed the Excel after SAP opened it, and then I opened it with the already existing “Excel application scope”.

So… Somehow, or the opened excel is not the same, or, the functionalities aren’t fully loaded when the file is opened by SAP. Or something else I’m not aware of!!

What I know is, I closed the excel opened by sap, and open it “myself” and everything works fine.

Side question: Write line has any limitation being used in .xlsx files?
Should I change format?!

@Mr_JDavey
Thank you for your help!
I was trying that already, but no error was occurring, actions after the write cells were being performed correctly inside the same excel, as I said, it was like those actions weren’t there…

1 Like

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