LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Ruby/Excel issue - Cross posted from Miscellaneous


All, apologies for the cross posting, but I had no takers on th
Miscellaneous forum.

I don't think this is pecifcally a Ruby problem, that's just what I wa
using when I encountered the issue below.:(

I am having a troublesome problem. I am trying to pull data out of
complex Excel workbook (several worksheets in the book) and make th
contents available for a variety of reporting uses. I am working i
Ruby - for no reason other than "just because".

All is going well when I have cells that contain simple data types, bu
as soon as there is any kind of complexity in a formula, I get a weir
negative number back instead of the contents. For example:

Cell K3 has this formula.....=VLOOKUP(H3,Quadrant_Table,3)
The value when that formula is executed is "Adopt" and that is wha
shows on the screen.
When I go in from Ruby (via WIN32OLE), I get the number -214682626
back.

The Ruby snippet that does this is

colIndex = @startCol
colIndex.upto(endCol) {|aCol|
currCell = ("#{@@colnames[aCol-1]}#{aRow}")
@cells << (sheet.Range(currCell) ['Value']).to_s

}
}
end

@cells is an array of individual cells. There are likely to be man
better (faster) ways of getting the range back in one fell swoop, bu
right now I am less interested in that. First get answers that yo
like, then improve the approacch!

For simple string values, non formula arithmetic values, this deliver
just what it should. However for these complex formulae the result i
always that funky -2146826265. This is also x'800A07E7' which look
suspiciously like an hresult value.

So the question is, how to I get the displayed value out of the cel
from my Ruby program?

Thanks in advance for any help.

Chri

--
seabird2
-----------------------------------------------------------------------
seabird20's Profile: http://www.excelforum.com/member.php...fo&userid=3703
View this thread: http://www.excelforum.com/showthread.php?threadid=56825

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/Link Issue (apologies for cross-posting) MorgSz Links and Linking in Excel 2 July 25th 07 08:12 PM
Miscellaneous Excel problem mmasse Excel Worksheet Functions 1 December 5th 06 07:27 PM
Duplicate Query with a twist.... (Cross Posted) Bryan Excel Discussion (Misc queries) 0 November 15th 06 11:26 AM
Ruby access to an existing Spreadsheet with complex formulae seabird20 Excel Discussion (Misc queries) 0 August 2nd 06 07:43 PM
Miscellaneous Irina Excel Worksheet Functions 4 February 28th 06 09:51 PM


All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"