Skip to main content

[archive] numeric data in Excel

  • September 27, 2009
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 14 November 2005]

I try to read an Excel file and I face a problem with some cells which contain numbers.

Particularly, a cell contains the number 4304403 and I get it in an alphanumeric variable.

77 CELL-VALUE pic x(50) value spaces.

INQUIRE EXCEL-WORKSHEET @Range0("D14")::Value IN CELL-VALUE

CELL-VALUE = 4,304403000000000E6


The sheet?s format is 'General' and I change it to 'Text'. I also disable the Background Error Checking. I notice that if I enter to the cell and leave without making any changes, then the variable gets the right value
CELL-VALUE = 4304403


Can someone please provide some code which:

- Change the cell?s or whole sheet?s format to 'Text'.

- Get the cell?s value always as alphanumeric

- Return the last row of a sheet witch contains data.

1 reply

[Migrated content. Thread originally posted on 14 November 2005]

I try to read an Excel file and I face a problem with some cells which contain numbers.

Particularly, a cell contains the number 4304403 and I get it in an alphanumeric variable.

77 CELL-VALUE pic x(50) value spaces.

INQUIRE EXCEL-WORKSHEET @Range0("D14")::Value IN CELL-VALUE

CELL-VALUE = 4,304403000000000E6


The sheet?s format is 'General' and I change it to 'Text'. I also disable the Background Error Checking. I notice that if I enter to the cell and leave without making any changes, then the variable gets the right value
CELL-VALUE = 4304403


Can someone please provide some code which:

- Change the cell?s or whole sheet?s format to 'Text'.

- Get the cell?s value always as alphanumeric

- Return the last row of a sheet witch contains data.

080309     INQUIRE EX-WORKSHEET @Range("A65536")::End(xlUp)::Row
080309     IN LastRowColA.