numberformat in Excel automation gives error

When I try to set numberformat in any way, I get “internal error 10 in module 45”. Anyone got an idea of what is wrong? My code: Sheet.Range(‘C’).NumberFormat := ‘@’; I’ve seen this code working many times before, but not in this special environment. It is Excel 2000 and Microsoft Excel 9.0 Object Library.

You have to select the entire row or column before applying numberformat… Range := ExcelWorkSheet.Range(‘D’ + ‘1’); Range := Range.EntireColumn(); Range.NumberFormat := ‘(* #.##0,00);(* (#.##0,00);(* “-”??);(@_)’;