Hi David,

What happens when you run this code?
>> only Console opens(command prompt)

Does the Excel window appear?
>>No

Do you receive an error?
>>No message appears

Do you have Excel installed on that PC?
>> Ms Excel is installed

Does the workbook already exist?  Or are you looking to create a new 
workbook?
>>already exists

Problem - unable to open Excel with this code.
Want to open (visible) and want to write text and then save.


Thanks
Riya


David Mullet wrote:
> Riya Rai wrote:
>> 
>> i am using below code for opening Excel application.
>> But it not opening  Excel file.
>> 
>> Code:-
>> require 'win32ole'
>> 
>> excel = WIN32OLE.new("excel.application")
>> excel.visible = true
>> workbook = excel.workbooks.open("c:\\temp.xls")
>> worksheet=workbook.worksheets(1)
>> 
>> 
>> i just want to open a excel file and write text in it.kindly help me.
>> 
>> Thanks in Advance
> 
> You'll need to provide more details.
> 
> What happens when you run this code?
> Does the Excel window appear?
> Do you receive an error?
> 
> Do you have Excel installed on that PC?
> Does the workbook already exist?  Or are you looking to create a new 
> workbook?
> 
> These links may help:
> 
> http://rubyonwindows.blogspot.com/2007/03/automating-excel-with-ruby-workbook.html
> 
> http://rubyonwindows.blogspot.com/search/label/excel
> 
> David

-- 
Posted via http://www.ruby-forum.com/.