Win32ole copying excel sheets

Hi,

I’m am trying to write a Ruby script that copies a worksheet from one
Excel
workbook to another. Does anyone know where there is some documentation
on
the specifically for the Excel Object Model for win32ole.

Normally I can piece together how to make the function calls in Ruby by
recording a macro and looking at the VB code that’s generated, but I can
figure this one out. Does anyone have any suggestions?

Thanks,

Bryan

Hi,

On 7/2/06, Bryan W. [email protected] wrote:

recording a macro and looking at the VB code that’s generated, but I can
figure this one out. Does anyone have any suggestions?

Thanks,

Bryan

http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel

That should be a start in the right direction.

Michael G.

Bryan W. wrote:

Hi,

I’m am trying to write a Ruby script that copies a worksheet from one Excel
workbook to another. Does anyone know where there is some documentation on
the specifically for the Excel Object Model for win32ole.

Normally I can piece together how to make the function calls in Ruby by
recording a macro and looking at the VB code that’s generated, but I can
figure this one out. Does anyone have any suggestions?

Have you tried MSDN? Microsoft tends to have copious docs on their
developer site.

I’ve taken a look at MSDN, but I can’t figure out how to translate their
code snippets for VB and C# into Ruby. In particular the VB line that
does
what I am trying to accomplish is:

Sheets(“Sheet 1”).Copy After:=Workbooks(“temp.xls”).Sheets(7)

Bryan W. wrote:

I’ve taken a look at MSDN, but I can’t figure out how to translate their
code snippets for VB and C# into Ruby.

Look for examples in JScript/JavaScript or VBScript. They may be easier
to translate to Ruby. Look in the MSDN scripting section.


James B.

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://yourelevatorpitch.com - Finding Business Focus

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs