Hello,

I am trying to open a excel file and write data, but i m getting runtime
error
 I checked the path is correct
new method works fine but open method throws error...can u pls help me
figure out this problem

*Code:*
require 'win32ole'
excel = WIN32OLE.new('excel.application')
excel.visible = true
excel.Workbooks.Open('D:\shiv.xls')
excel.range('A1').value = 'Hello, world.'
excel.Close
excel.Quit


*Error:*
C:\Ruby\bin>ruby C:\Ruby_Scripts\Ex_open.rb
C:/Ruby_Scripts/Ex_open.rb:6:in `method_missing': Open
(WIN32OLERuntimeError)
    OLE error code:800A03EC in Microsoft Office Excel
      'D:\shiv.xls' could not be found. Check the spelling of the file name,
and
 verify that the file location is correct.
If you are trying to open the file from your list of most recently used
files, m
ake sure that the file has not been renamed, moved, or deleted.
    HRESULT error code:0x80020009
      Exception occurred.
        from C:/Ruby_Scripts/Ex_open.rb:6

Regards,
Shiv

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to