Search code examples
blueprism

Blueprism Write A Collection To An Excel File Issue


I am attempting to create a blank excel file, write a collection to the file and save it at a location. I am able to create a file, however when I run the write collection step I get a generic code error message. I have also noticed that the Save As Step doesn't seem to work correctly. It outputs blank as the Workbook Name. I believe the issue may be linked to a column in my collection which is a set of inserts. The job seems to work when the collection is empty, only producing the error when it is populated.

enter image description hereenter image description hereenter image description hereenter image description hereenter image description here


Solution

  • You've stumbled across issues that can be really tricky to debug.

    The issue with the 'Save Workbook As' is a Blue Prism bug that you can fix on your own. Open the action in Object studio and you will notice that the Code stage outputs the result to 'workbookname' instead of 'newworkbookname'. Change that and it will work as intended.

    As for the issue with the 'Write Collection', if you say that it works if there are no rows then the values may be the issue. I am not quite fond of the equal sign at the beginning of the value, what happens if it's not there? Have you tried including apostrophe in front of the string to force the value into text and not a function?

    Like this:

    ' = insert into dbo.table ...