Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作为标题,我尝试了一些解决方案,但都没有奏效。
XLApp.Application.cells[1, 1].Value := ''; XLApp.Application.cells[1, 1].Value := nil; XLApp.Application.cells[1, 1].Value := EmptyParam;
可用于清除单元格内容的变量值为Unassigned.
Unassigned
Cells[1,1].Value := Unassigned;
或者,您可以Clear在单元格上使用该方法。
Clear
Cells[1,1].Clear;
我个人认为后者更具可读性。