$ 0 0 It seems like AutoFitColumns throws a nullref error on an empty sheet, or possibly a sheet with a single empty cell.