× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Dennis,
You have been a great help as I learn how to work with updating worksheets.
I appreciate your explanationa and have learned a lot.


 
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 
IBM  Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM  Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3
  
 






________________________________
From: Dennis Lovelady <iseries@xxxxxxxxxxxx>
To: RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Sent: Fri, June 11, 2010 6:35:24 PM
Subject: RE: Update a Cell in a MS EXCEL Worksheet

Please explain what you mean when you say the cell is define as general.  I
think you mean that its display format is general.  If so, then that means
only that Excel will display it in its choice of formats; it has nothing
(little) to do with the content itself.

When retrieving values from cells, I have found it useful to always always
always obtain the cell type first and then retrieve the data according to
cell type.  That cannot go wrong!  What you *believe* is in the cells has
little to do with how Excel handles the content.  Numbers look like strings
look like numbers...

Regards,
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I have made this letter longer than usual, because I lack the time to make
it short."
        -- Blaise Pascal
.
In the worksheet I am working with, column 0 is formatted as a General
type field.
I am attempting to use the following code to retreive the contents of
that column:
Item  = %Trim(String_getBytes(HSSFCell_getStringCellValue(Cell)));
Where Item is a character field.
I am receiving the following error:
Message . . . . :   Java exception received when calling Java
method.


Cause . . . . . :   RPG procedure PROCESSSHE in program
QGPL/XL_UPDTEST
  received Java exception "java.lang.NumberFormatException: You cannot
get a
  string value from a numeric cell" when calling method
"getStringCellValue"
  with signature "()Ljava.lang.String;" in
class

"org.apache.poi.hssf.usermodel.HSSFCell".

Since this is defined as General, and has both numeric and character
data in it, I do not understand why I am receiving this error.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.