You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works in MRI but fails in JRuby. Maybe related to #1932 but I'm not certain.
require 'win32ole'
begin
# Create an instance of the Excel application object
excel = WIN32OLE.new('Excel.Application')
# Make Excel visible
excel.Visible = 1
excel.DisplayAlerts = false
# Add a new Workbook object
wb = excel.Workbooks.Add
# Get the first Worksheet
ws = wb.Worksheets(1)
# Can set a single value, works on JRuby and MRI
ws.Range("A1").Value = 17
# Should be able to set a range of values, works on MRI but fails on JRuby
ws.Range("B1:C2").Value = [
["b1", "c1"],
["b2", "c2"]
]
rescue => e
p e
ensure
#excel.Quit
end
return:
java.lang.RuntimeException: createVariant() not implemented for class org.jruby.RubyArray
This example is a very common way to set values in Excel using Ruby. The workaround is to set each cell individually but that means a performance hit of 10x or greater (probably due to crossing into/out-of COM all the time).
The text was updated successfully, but these errors were encountered:
@chuckremes I am not asking you to buy me Excel either. I just wish we could have figured out how to make a nice exerciser for this. I am not the windows guy you think I am :)
Works in MRI but fails in JRuby. Maybe related to #1932 but I'm not certain.
return:
java.lang.RuntimeException: createVariant() not implemented for class org.jruby.RubyArray
This example is a very common way to set values in Excel using Ruby. The workaround is to set each cell individually but that means a performance hit of 10x or greater (probably due to crossing into/out-of COM all the time).
The text was updated successfully, but these errors were encountered: