从 Excel 填充时,Ruby(鞋子)列表框崩溃
我在使用鞋子时遇到问题。我基本上试图打开一个 Excel 文档并将工作表的名称传递到列表框。选择文件后按下按钮将调用以下方法。 (这一切都有效并且文件打开)
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
不仅名称没有显示在列表框中,应用程序在加载框后不久就崩溃了,没有错误。 para @excWS 显示工作表的名称没有问题。
我做错了什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是编码的问题
这有效
it is the encoding that was the problem
This works