Board index » delphi » Excel - Range property NumberFormat is ReadOnly in the Delphi

Excel - Range property NumberFormat is ReadOnly in the Delphi

Hi all, in the Visual Basic application I correct format Excel columns as
 ExlSheet.Range("A2", "A100").NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 "
or
  ExlApp.Workbooks(1).Worksheets(2).Range("B2",
"B100").NumberFormat="#,##0.00_ ;[Red]-#,##0.00 "
(where ExlSheet and ExlApp are ExcelWorksheet and ExcelApplication)

But in the Delphi, this property is Read Only. Line for reading as
  Strng :=  ExList.Columns.Cells.Range_['F2', 'F999'].NumberFormat;
works OK, but writing
  ExList.Columns.Cells.Range_['F2', 'F999'].NumberFormat =  '#,##0.00_
;[Red]-#,##0.00 '
do not.

Please help and send me your suggestions. Thanks. Vladimir

 

Re:Excel - Range property NumberFormat is ReadOnly in the Delphi


Sorry, mea culpa. Bad value in the string. Vladimir.

"Vladimr Janda" <janda.safes...@telecom.cz> p1e v diskusnm p?spvku
news:3ca0e0fa$1_1@dnews...

Quote
> Hi all, in the Visual Basic application I correct format Excel columns as
>  ExlSheet.Range("A2", "A100").NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 "
> or
>   ExlApp.Workbooks(1).Worksheets(2).Range("B2",
> "B100").NumberFormat="#,##0.00_ ;[Red]-#,##0.00 "
> (where ExlSheet and ExlApp are ExcelWorksheet and ExcelApplication)

> But in the Delphi, this property is Read Only. Line for reading as
>   Strng :=  ExList.Columns.Cells.Range_['F2', 'F999'].NumberFormat;
> works OK, but writing
>   ExList.Columns.Cells.Range_['F2', 'F999'].NumberFormat =  '#,##0.00_
> ;[Red]-#,##0.00 '
> do not.

> Please help and send me your suggestions. Thanks. Vladimir

Other Threads