[Ironruby-core] Interop with Excel
jdeville at microsoft.com
Wed Apr 8 13:00:44 EDT 2009
When I do this, Excel opens up, but it opens up without a workbook. If I open a file manually (via Excel's GUI), then the ActiveWorkbook is populated.
I don't know the Excel API, but if excel.workbooks.open("Foo.xls") is supposed to open a workbook in the Excel instance, then you've found a bug. Excel.workbooks.open is being overridden by Ruby's Kernel#open method.
If this is the case, can you open a bug at http://rubyforge.org/tracker/?func=browse&group_id=4359&atid=16798 and assign it to Tomas?
> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Jeff Siebold
> Sent: Wednesday, April 08, 2009 9:08 AM
> To: ironruby-core at rubyforge.org
> Subject: Re: [Ironruby-core] Interop with Excel
> I'm replying to my own post because it looks like I found part of my
> problem. I changed the code to:
> require 'Microsoft.Office.Interop.Excel, Version=184.108.40.206,
> Culture=neutral, PublicKeyToken=71e9bce111e9429c'
> include Microsoft::Office::Interop::Excel
> excel = ApplicationClass.new
> excel.Visible = true
> and that works. But I'm still having trouble getting access a Workbook:
> p excel.ActiveWorkbook
> workbooks = excel.Workbooks
> p workbooks.respond_to?('Open')
> I would be grateful for any help. Thanks, Jeff
> Jeff Siebold wrote:
> > The following code runs fine:
> > require 'Microsoft.Office.Interop.Excel, Version=220.127.116.11,
> > Culture=neutral, PublicKeyToken=71e9bce111e9429c'
> > Excel = Microsoft::Office::Interop::Excel
> > but when I try to get the Application object as follows:
> > app = Excel.Application.new
> > I get the following error:
> > excel.rb:0: undefined method `Application' for
> > Microsoft::Office::Interop::Excel:Module (NoMethodError)
> > am I not understanding how this works or is this just not working
> Posted via http://www.ruby-forum.com/.
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
More information about the Ironruby-core