[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

win32ole question....

dave rose

2/1/2007 9:09:00 PM

can anybody point me to a good web page or know how to:
using ruby's WIN32OLE 'save as' a current
Worksheet into a csv format by only using
ruby's WIN32OLE access?

--
Posted via http://www.ruby-....

5 Answers

Jano Svitok

2/1/2007 11:24:00 PM

0

On 2/1/07, Dave Rose <bitdoger2@yahoo.com> wrote:
> can anybody point me to a good web page or know how to:
> using ruby's WIN32OLE 'save as' a current
> Worksheet into a csv format by only using
> ruby's WIN32OLE access?

I'd try this: (I'm assuming that you want to work with excel)

1. record a macro doing the desired action (i.e. start recording
macro, save the worksheet as csv file and stop recording).

2. open VBA editor to see the source code of the macro

3. translate it into ruby/WIN32OLE

For the last step, you'll need to pick up only part of the macro -
there'll be probably other commands that you don't need. Look the
commands in the help or on MSDN to see what they do. For the Ruby
part, there's a chapter on this in Programming Ruby
(http://ruby-doc.org/docs/ProgrammingRuby/html/...). You can
search the archive of the list for more info (Li Chen was a guy that
worked a lot with Excel, so look up his threads)

David Mullet

2/2/2007 2:43:00 AM

0

On Feb 1, 4:08 pm, Dave Rose <bitdog...@yahoo.com> wrote:
> can anybody point me to a good web page or know how to:
> using ruby's WIN32OLE 'save as' a current
> Worksheet into a csv format by only using
> ruby's WIN32OLE access?
>
> --
> Posted viahttp://www.ruby-....

workbook.SaveAs 'myfile.csv', xlCSV

....where xlCSV = 6.

http://www.rubygarden.org:3000/Ruby/page/show/Scri...

Mully

dave rose

2/2/2007 4:20:00 PM

0

David Mullet wrote:
> On Feb 1, 4:08 pm, Dave Rose <bitdog...@yahoo.com> wrote:
>> can anybody point me to a good web page or know how to:
>> using ruby's WIN32OLE 'save as' a current
>> Worksheet into a csv format by only using
>> ruby's WIN32OLE access?
>>
>> --
>> Posted viahttp://www.ruby-....
>
> workbook.SaveAs 'myfile.csv', xlCSV
>
> ...where xlCSV = 6.
>
> http://www.rubygarden.org:3000/Ruby/page/show/Scri...
>
> Mully

thanx...fyi...it's a combo of both of your response...i did a macro and
used your's above to get...
excel.ActiveWorkbook.SaveAs("c:\\augcsv\\myfile1.csv", xlCSV)
...where xlCSV = 6.
...dave

--
Posted via http://www.ruby-....

Bernard Kenik

2/3/2007 12:26:00 AM

0

On Feb 2, 11:20 am, Dave Rose <bitdog...@yahoo.com> wrote:
> David Mullet wrote:
> > On Feb 1, 4:08 pm, Dave Rose <bitdog...@yahoo.com> wrote:
> >> can anybody point me to a good web page or know how to:
> >> using ruby's WIN32OLE 'save as' a current
> >> Worksheet into a csv format by only using
> >> ruby's WIN32OLE access?
>
> >> --
> >> Posted viahttp://www.ruby-....
>
> > workbook.SaveAs 'myfile.csv', xlCSV
>
> > ...where xlCSV = 6.
>
> >http://www.rubygarden.org:3000/Ruby/page/show/Scri...
>
> > Mully
>
> thanx...fyi...it's a combo of both of your response...i did a macro and
> used your's above to get...
> excel.ActiveWorkbook.SaveAs("c:\\augcsv\\myfile1.csv", xlCSV)
> ..where xlCSV = 6.
> ..dave
>
> --
> Posted viahttp://www.ruby-....- Hide quoted text -
>
> - Show quoted text -

note: if the workbook already defined then workbook.SavesAs("c:/augcsv/
myfile1.csv", xlCSV) works

The Peeler

1/26/2012 5:48:00 PM

0

On Thu, 26 Jan 2012 09:13:55 -0800 (PST), A Moose in Love with Nazi Scum
wrote:

>> Hmmm... has any of the German Nazis ever apologized officially for what they
>> did? I know that many of the cowards rather insisted, after the war, that
>> they had been resistence fighters, and they even believed it, though the
>> facts proved them to be lying!
>>
>> Remember MoooooseShit: your sort ALWAYS are mentally sick!!! But you know
>> it! ;-)
>
> For someone who criticizes Heinrich's English, I must say that your
> spelling is pretty fucked up. WTF is 'resistence'? has any? Try
> 'have any'. idiot.

LOL!!! Why should I try it, asshole? Better try stopping sucking Nazi cock,
you sick farm boy!