From: Chris Hulan Date: 2006-06-15T22:38:10+09:00 Subject: Re: Using MSScriptControl with Rubyscript Wai-Kee Chung wrote: > I am attempting to use the MSScriptcontrol with rubyscript: > > objShell = WIN32OLE.new("WScript.Shell") > > com1 = WIN32OLE.new('comobject.name') > script = WIN32OLE.new("MSScriptControl.ScriptControl") > script.language = "RubyScript" > > script.addObject("com1",comObject,true) > > However the following error occurs: > [Bug] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-mswin32] > > Any ideas? Or am I doing something wrong here? Posting the full script would help. However, I took a swing at it and came up with this: p `ruby -v` require 'win32ole' objShell = WIN32OLE.new("WScript.Shell") com1 = WIN32OLE.new('Excel.Application') script = WIN32OLE.new("MSScriptControl.ScriptControl") script.language = "RubyScript" script.addObject("com1",com1,true) The output is: >ruby -w winScript.rb "ruby 1.8.2 (2004-12-25) [i386-mswin32]\n" winScript.rb:7:in `method_missing': (WIN32OLERuntimeError) OLE error code:800A017C in ScriptControl A script engine for the specified language can not be created. HRESULT error code:0x80020009 Exception occurred. from winScript.rb:7 >Exit code: 1 So it looks like MSScriptControl doesn't like "RubyScript". HtH Cheers Chris -- Posted via http://www.ruby-forum.com/.