Read column with one row

Hi, I have to read a column in xlsm starting from “A1”, but this column could have only one row. In this case I have an exception:

    `testreadcolumn has thrown an exception`

    Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).

    Source: Write line

    Exception Type: NullReferenceException

How can I do?

1 Like

Use a try catch activity, or another approach would be using read cell and check if its empty and go from there

How your reading xlsm file.Even if there is no item in the cell A it returns empty.You don’t get null exception.
Error occurred at write line.
Could you please attach your workflow.

Hi all,

I notized this behavior as well. Please find attached my workflow. If you use an excel file with one row you can reproduce the error mentioned above. If you use two rows it works fine.

Since my excel file could have any amount of filled rows as well as one filled row wirth many columns, read cell would be only a quick solution.

Some hints how a can still use read column for this?

Main.xaml (6.4 KB)

I think i’ve actually done something similar. Had to make sure that the TypeArgument in the For Each activity was Object.

I’m afraid that this does not solve my problem. With read column I get an IEnumerable, not a datatable.

Any other hints?