"Martin Stannard" <martin / massive.com.au> wrote in message news:C1126400B227D411AC1200A00CC456B501550FBA / emailserver.massive.com.au... > Hi, > > I'm trying to open a file using win32ole in excel: > > @app = WIN32OLE.new("excel.application") > @app.visible = true > template = "racetemplate.xls" > @book = @app.Workbooks.Open(template) > @sheet = @book.Worksheets(1) > > results in the following error: > > (druby://127.0.0.1:9001) ./excelmaker.rb:85:in `method_missing': Open > (WIN32OLERuntimeError) > OLE error code:800A03EC in Microsoft Excel > 'racetemplate.xls' could not be found. Check the spelling of the file > name, and verify that the file location is correct. > Has anyone got a sample of loading an xls or xlt template into Excel via > win32ole? My best guess is that the current directory is not what you think it is. It will probably work if you specify the full path. I just got the latest WIN32OLE compiled and tested it. I got a segmentation fault on the ie.rb sample, but I could get it work on other components. However, my long term problem with WIN32OLE remains: components with an optional parameter seems to not be working. I got this document object with a Save method taking a filename and an optional second parameter. This won't execute. Mikkel