You can re-open the class that defines a Worksheet Range and include Ruby's
Enumerable as a mixin

--
Will Green
http://hotgazpacho.org/


On Thu, Jul 15, 2010 at 8:10 PM, Eduardo Blumenfeld <li...@ruby-forum.com>wrote:

> Hi,
>
> I'm trying to do the following:
>
> ----------------
> load_assembly "Microsoft.Office.Interop.Excel"
> include Microsoft::Office::Interop
>
> app = Excel::ApplicationClass.new
> worksheet =
> app.workbooks.open("samename.xlsx".to_clr_string).worksheets[1]
>
> range = worksheet.range("A1:Z1".to_clr_string)
> # at this point I can:
> puts range[1].value # works
>
> but I can't do
> range.each {|r| ...}
>
> is there any way of defining, extending the class to accept each (and
> size for the matter) as methods?
>
> Thank you very much
>
> Eduardo Blumenfeld
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to