cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while adding row in Document

SUMEETMANGLESH
Level 3
In one of my process, I want to open the document and add a table with (1 row 1 column) and insert the audit log data. But while adding row I am getting an exception. I create a blank document and call MS Word VBO --where I have created new page as -AddRowWithData and pass 3 parameters i.e handle,document Name and test to be entered as (22 Jun 2017 06:57:44 - The user admin manually marked an item with an exception). But I am getting exception as : Internal : Could not execute code stage because exception thrown by code stage: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)). Your help and suggestions will be appreciated. Please find attached document for more clarity. Code for adding row : Dim doc as Object = GetDocument(handle,documentname) Dim w As Object = doc.Application doc.Tables.Add(0,1, 1).Cell(1,1).Range.Text = TableData
2 REPLIES 2

Denis__Dennehy
Level 15
Firstly, the recommendation is to create a seperate object if you want to create new actions rather than adding them directly to the utility objects provided by Blue Prism. If you modify the packaged objects you are making it difficult to take new versions of those objects in future because you have bespoked them. Have you tried creating a new seperate action to add your table to the document and then using teh existing actions for adding rows/setting table values? My recommendation is to use a template document of the doc you need to create. So your template document will have bookmarks, and empty tables already in it for you to then populate by your process. This makes your interface quicker and easier.

Thank you, Denis, for your reply. Yes I am adding new actions for creating new actions. Regarding adding a table in the document. I do not find any option to do that even though I create a new action.