The first parameter I need to pass into getCell on line2 is a complex
object(not String/double).
Could anyone please teach me how to do this call in Ruby?
The first parameter I need to pass into getCell on line2 is a complex
object(not String/double).
Could anyone please teach me how to do this call in Ruby?
Look at 1.9 WIN32OLE documentation. The last paragraph discusses the
returning by reference (in short, you’ll find the result in
WIN32OLE::ARGV).
I went through all the existing threads before I posted this one
because I did not fully understand them. Could anyone give me some
more detailed examples.
excel = WIN32OLE.new(“excel”)
because I did not fully understand them. Could anyone give me some
more detailed examples.
Can you specify the problem in more detail? Is it that
(1) you need to pass an object to the method,
or
(2) the method returns the complex object, and you actually do not
need to pass it in,
or
(3) both?
If you can specify the exact API (if it is public) it would be easier
to help you.
So for now:
for (1) I think that’s easy. WIN32OLE.new(type)
for (2): try passing 0 or nil as the parameter, and read the result
from WIN32OLE::ARGV.first
if 0/nil doesn’t work then create an empty object and pass that. Try
inspecting ARGV to find out what stuff does it contain.
(I don’t remember why but) in some cases I used
WIN32OLE#invoke(method, *args) to call the COM object.
(2) the method returns the complex object, and you actually do not
for (2): try passing 0 or nil as the parameter, and read the result
from WIN32OLE::ARGV.first
if 0/nil doesn’t work then create an empty object and pass that. Try
inspecting ARGV to find out what stuff does it contain.
(I don’t remember why but) in some cases I used
WIN32OLE#invoke(method, *args) to call the COM object.
I am using Ruby 1.8.6 now and trying to so a pass by reference COM
object(not String/double).
(1) you need to pass an object to the method,
for (1) I think that’s easy. WIN32OLE.new(type)