Unable to write to Excel wiith roo

943 views
Skip to first unread message

Crazy Frog

unread,
May 16, 2013, 5:39:21 AM5/16/13
to ruby...@googlegroups.com
When i try to write to excel i get an error.

the code i use

require "roo"
include Roo

myExcel = Excelx.new(myExcelFile)
myExcel.default_sheet = 'firstSheet'

myExcel.set_value(1,1, "this is a test')



The error that i get after execute is

c:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-1.11.2/lib/roo/generic_spreadsheet.rb:381:in `method_missing': private method `set_value' called for nil:Roo::Excelx (NoMethodError)
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-1.11.2/lib/roo/excelx.rb:136:in `method_missing'
    from functions.rb:64:in `writePerformanceToExcel'
    from H:/Watir scripts/Framework (Excel script)/timer.rb:54:in `<main>'


Who can help me, so that i can write to Excel?


Thomas Preymesser

unread,
May 17, 2013, 6:01:27 AM5/17/13
to ruby...@googlegroups.com

There is no write access to spreadsheet files (except for google spreadheets) in roo.

-thomas

--
Ohne Aenderungen bleibt alles gleich

--
You received this message because you are subscribed to the Google Groups "ruby-roo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-roo+u...@googlegroups.com.
To post to this group, send email to ruby...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-roo?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pablo Herrero

unread,
May 17, 2013, 1:53:11 PM5/17/13
to ruby...@googlegroups.com

You have to use set instead of set_value, for modifying the cells, but it's only an in-memory modification.

Reply all
Reply to author
Forward
0 new messages