I am using 'win32ole' to script excel.
In python I use the COM makepy utility which allows faster processing
of ole commands. It doesn't need to do dynamic look ups.
Python code:
from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
Does Ruby have a similar function?
I found 'olegen.rb' but after I generated a file, I haven't got it to
work.
-thanks
You can simply use the WIN32OLE object ...
It's dynamic.
PickAxe2 has a great chapter on it. ruby-doc has decent information too.
j.
···
On 11/8/05, greg.rb <ghalsey@yahoo.com> wrote:
I am using 'win32ole' to script excel.
In python I use the COM makepy utility which allows faster processing
of ole commands. It doesn't need to do dynamic look ups.
Python code:
from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
Does Ruby have a similar function?
I found 'olegen.rb' but after I generated a file, I haven't got it to
work.
-thanks
many thanks...however, something is still wrong. I am using the 1
click installer version. I had to download the olegen.rb from the RAA.
here is what happened:
On Thu, Nov 10, 2005 at 04:32:13AM +0900, greg.rb wrote:
many thanks...however, something is still wrong. I am using the 1
click installer version. I had to download the olegen.rb from the RAA.
here is what happened:
C:\ruby\lib\ruby\site_ruby\1.8>irb
irb(main):001:0> require 'excel'
LoadError: No such file to load -- oleproperty
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__'
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require'
from c:/ruby/lib/ruby/site_ruby/1.8/excel.rb:2
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__'
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require'
from (irb):1
irb(main):002:0> require 'win32ole'
=> false
irb(main):003:0> require 'win32ole'
=> false
irb(main):004:0> require 'excel'
=> false
irb(main):005:0> xl=Excel_Application_10.new
NameError: uninitialized constant Excel_Application_10
from (irb):5
from :0
irb(main):006:0>
It slowed things down. I guess "require 'excel.rb'" slows things down
if you aren't doing much work with excel to make a difference.
I had much more interesting results vs. python which I am posting on a
new thread. Ruby was 2x as fast as Python for accesing an Excel file
reading 1000 lines of data!