Hello
My issue is related to Excel and SAP reporting, I need to download a report from SAP and then extract that report and put it in a collection, however, I've noticed that when I download the report, it can sometimes have additional spaces in the header names, when this happens I cannot reference the collection because now it has a different header name, i.e. [SAP Report.Value] [SAP Report. Value].
What I'm trying to do is to trim all cells in the excel file before adding its contents to a collection, to do this, I'm trying to use a code stage with the following VB code:
Dim worksheet As Object
worksheet = GetWorkbook(handle,Nothing).ActiveSheet
Dim cell as Object = worksheet.Range
For Each cell In worksheet.UsedRange.SpecialCells(xlCellTypeConstants)
cell = WorksheetFunction.Trim(cell)
Next cell
however I'm getting the following error
xlCellTypeConstants is not declared, It may be inaccessible due to its protection level.
this code works in excel but since I'm new to code stages in BP, any idea of why I'm getting this error or any suggestions to trim all content before importing to a colleciton?
thanks in advance