From: Riya Rai Date: 2008-12-30T19:01:54+09:00 Subject: Re: unable to open Excel file Thanks every one Now the below code is working 'To open Excel file require 'win32ole' xl = WIN32OLE.new('Excel.Application') xl.Visible = 1 wb = xl.Workbooks.Open('c:\file.xls') Thanks again to all Riya Mohit Sindhwani wrote: > Riya, > > Not sure if this is the problem but your code is: > > excel = WIN32OLE.new("excel.application") > > On David's site, the line is: > > excel = WIN32OLE::new('excel.Application') > > Notice the capital A in Application; however, in irb on my PC, it works > irrespective of the case. So, that's probably not the problem. What > version of Excel is installed on the PC on which you are running the > code? Do you get any other errors at all? > > Could you try going line by line in irb to see if it dies anywhere? > > Cheers, > Mohit. > 12/30/2008 | 3:24 PM. -- Posted via http://www.ruby-forum.com/.