AsVariant and null hangs on error

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
zvasku
Posts: 14
Joined: Wed Aug 01, 2012 2:22 pm

AsVariant and null hangs on error

Post by zvasku »

Hello,

If I set null to AsVariant(col,row), application raises exception and excel file is corrupted. AsVariant function should handle null state properly.

Thanks
Zdenek
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: AsVariant and null hangs on error

Post by larsa »

Hello

The component is handling it properly. You get an exception. You can't assign a null value to a cell.
Lars Arvidsson, Axolot Data
zvasku
Posts: 14
Joined: Wed Aug 01, 2012 2:22 pm

Re: AsVariant and null hangs on error

Post by zvasku »

I think it's not good behaviour. If I set Null to cell using AsVariant, cell should be cleared. Thats's why we use variants with nulls.

This should work directly like this:

XLS[].AsVariant[]:=Dataset.Fields[].AsVariant
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: AsVariant and null hangs on error

Post by larsa »

Hello

AsVariant has worked this way since it was introduced several years ago, It's expected to work this way.
Lars Arvidsson, Axolot Data
Post Reply