ExcelApplicationScope does not work if path stored in datatable

Using Studio 2020.4.1 When I use ExcelApplicationScope and pass it “c:\foo.xlsx” it works fine. but if I store that same string as an object in a datatable

| “key” string | “value” object |

Using AddDataRow, then later pull it out again using LookupDataTable, placing it into a string variable, when I use WriteLine to look at that variable it appears identical to the one above. However when I now use that variable in ExcelApplicationScope it now gives me:

Excel Application Scope: The given path’s format is not supported.

Nor does…
evaluate to True.

Any ideas why this could be?

My dependencies are…

“main”: “Main.xaml”,
“dependencies”: {
“System.Text.RegularExpressions”: “[4.3.1]”,
“UiPath.Database.Activities”: “[1.3.7369.25200]”,
“UiPath.Excel.Activities”: “[2.8.5]”,
“UiPath.Mail.Activities”: “[1.8.5]”,
“UiPath.OmniPage.Activities”: “[1.5.0]”,
“UiPath.System.Activities”: “[20.4.0]”,
“UiPath.UIAutomation.Activities”: “[20.4.1]”
“webServices”: ,
“schemaVersion”: “4.0”,
“studioVersion”: “”,

May i know what is the type of variable? If possible provide screenshots pls.

Give a try on adding toString() to the pulled Out value from the keyvalue Datatable as the value column is of datatype object

I’ve tried taking what comes back out of the datatable as an object. then doing .ToString() on that and storing the result into a seperate string variable. Still not working.

the odd thing is length seems to be one character more than I can count. but I’ve tried Trim() and that makes no difference.

OK I think my pain was just I had picked up hidden character from somehow, So when I was assigning into the datatable I was always putting the hidden character into it. I’m thinking maybe a \b backspace character or something.

Coupled with also starting off by doing “c:\\dev\\boo.xlsx” using the Assign activity when I just needed to do “c:\dev\boo.xlsx” which I also got confused about. So I didn’t need to use an additional object variable in the end.

Ahh my fixing commit shows rogue characters at the start, when I was assigning to the variable… so it was a case of unicode Byte Order Mark header (BOM header) striking again.

1 Like

So the issue is resolved?

yes. Although it might be nice to make the Excel Application Scope detect and ride-out a BOH if it gets given one. Not sure where the BOH came from.

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