Reputation: 111
As title, there are some solution I had tried, but all of them didn't work.
XLApp.Application.cells[1, 1].Value := '';
XLApp.Application.cells[1, 1].Value := nil;
XLApp.Application.cells[1, 1].Value := EmptyParam;
Upvotes: 0
Views: 2063
Reputation: 613053
The variant value that can be used to clear the contents of a cell is Unassigned
.
Cells[1,1].Value := Unassigned;
Alternatively you can use the Clear
method on a cell.
Cells[1,1].Clear;
Personally I find the latter to be more readable.
Upvotes: 4