in reply to Re: Reading from Excel
in thread Reading from Excel
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Reading from Excel
by dimmesdale (Friar) on Aug 09, 2002 at 15:16 UTC | |
Have you debugged any to narrow the problem down? update Maybe you should check out Win32::OLE Tips and Tricks with Excel. /update | [reply] [d/l] |
by Hrvoje (Initiate) on Aug 09, 2002 at 15:53 UTC | |
I can't give you the spreadsheet, it's not mine, sorry (company policy)... When I print out the $value, I get the same result over and over (that is "-2146826259", and the expected result should be a positive number not bigger than 100,000). If I use:
to retrieve cell data then I get #NAME!. I even tried debugging like this:
and it returns "10", which is VT_ERROR. I repeat, when you look at it in Excel application, it displays the correct results. | [reply] [d/l] [select] |
by dimmesdale (Friar) on Aug 09, 2002 at 18:50 UTC | |
Update Well, cacharbe is probably right, so what I say may not be applicable. I'm glad that's never happened to me :) /update You don't modify anything in the program do you -- I mean modify anything in Excel with the program? The negative integer (overflow?) sounded familiar, but I didn't find it in the docs...
(There was this, but I don't think it applies here)
If you're modifying any of the values within the program it by be noteworthy to see that code -- maybe something went wrong there? But (as I suspect since you say you saw it in Excel correctly so I guess you're not modifying anything), you may want to go to the Parse Excel module listed by someone else below. The only thing that comes to mind is that you might be referring to a cell that is out of bounds -- but then Excel would proably raise an exception, so its probably not that. | [reply] [d/l] |
by cacharbe (Curate) on Aug 09, 2002 at 19:23 UTC | |
Debug a little using Win32::OLE->LastError(). After you try to open your files, print Win32::OLE->LastError()."\n";, after you try to get the values, print Win32::OLE->LastError()."\n"; You get the idea. Something is happening that you are making assumptions about, and I think somewhere your assumptions are wrong, or as Inigo would say "I do not think it means what you think it means." Perhaps if you built an example that breaks but doesn't use proprietary files such that you could post the code. As I say, I tried to replicate your error using the code given without any luck, and I can post my code if you like to double check my understanding vs. your meaning. C-. --- | [reply] [d/l] [select] |