Error on ClearFormats

Does anyone know what would cause an exception to be thrown in the following statement?

// assume a Worksheet, wksht exists with valid Excel data…
wksht.Cells.ClearFormats(0, 0, wksht.Cells.MaxRow, wksht.Cells.MaxColumn);

I’m pretty sure that that is the line causing the exception.
-Steve

Hi Steve,

Could you send me your template file and more code on this issue? Thanks.