From: Bernhard Leicher Date: 2003-11-17T10:25:35+09:00 Subject: Re: Scrounging for WIN32OLE <--> MS-Excel Examples In dhtapp wrote: > I've suddenly developed an interest in populating an Excel worksheet > from within a little simulation I'm running. > Does anyone know of some docs or guidelines posted somewhere that I > may have missed? > Hi, there's a page on the Rubygarden Wiki: http://www.rubygarden.org/ruby? ScriptingExcel (maybe I'll find the time to add to the page what I learned so far) A great resource for general and programming Excel knowhow is Chip Pearson's site, for addressing cells in a range, take a look at http:// www.cpearson.com/excel/cells.htm Some examples of addressing cells by index: # supposed that "sheet" contains a reference to an Excel worksheet sheet.range("a1").item(2,1).value=5 # 5 goes to B1 # or get cell A1 first range = sheet.range("a1") # and use that from now on range.item(3,1).value=6 # this should also be possible sheet.cells(4,1).value=7 Parameters are in the order: rowindex, columnindex. In VBA you can omit item and value, as they are somehow default properties: VBA: range("a1")(3,1)=5 Ruby: range("a1").item(3,1).value=5 Regards, Bernhard