Ruby (Shoes) List box crash when populating from excel

Posted by DurkD on Stack Overflow See other posts from Stack Overflow or by DurkD
Published on 2011-09-20T19:54:32Z Indexed on 2011/11/23 1:50 UTC
Read the original article Hit count: 241

Filed under:
|
|
|

I've got a problem when using Shoes. I'm basically trying to open an excel document and pass the names of the worksheets to a list_box. The following method is called on a button press after selecting a file. (This all works and the file opens)

exc = WIN32OLE::new('excel.Application')
excWB = exc.Workbooks.Open(xlsFile)
@excWS = Array::new
exc.visible = true
excWB.Worksheets.each { |ws| @excWS.push(ws.name) }
para @excWS
list_box :items=> @excWS  

Not only do the names not show up in the list_box, the app crashes shortly after loading the box with no error. para @excWS shows the names of the worksheets with no problem.

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about excel