From: Gustav Paul Date: 2006-12-06T20:53:18+09:00 Subject: Re: MS Office and win32ole on Linux Gustav Paul wrote: > Hi > >> The problem is, that win32ole is a windows extension, you have linux >> ruby and office running under wine. So you have to make them talk to >> each other. You need to somehow compile the win32ole extension under >> linux to use wine to talk to msoffice. I would say that: >> >> 1. it should be possible >> 2. many people will thank you for that ;-) >> 3. certainly it is not easy - you'd need to know a bit of ruby >> internals, a bit of wine, a bit of OLE and you'd need to write C code >> during the process. >> >> > Thanks, I can see why people would be thankful! > I'll give it a shot, can't be that difficult ;] > > I had a vague inkling that it wouldn't be simple, > Thanks for the reply! > > Gustav > > > > I bailed on the 1-2-3, as I decided to try some easier sounding ways first, one of which turned out to work! :) In the end I installed office 2000 with Crossover, then I used the windows installer to install windows ruby into the same bottle as office. Finally I put the following bash script in my /usr/bin directory so I can run my ruby files with '#> wruby some_script.rb' The script is as follows, I've never done bash scripting before, so I think I cheated by using the 'env ruby' part, but hey, why code bash when you can code ruby? ;) ==/usr/bin/wruby #!/usr/bin/env ruby `/opt/cxofficebeta/bin/wine --bottle myBottle --cx-app ruby.exe #{ARGV.join(" ")}` In one instance, I have a .rb file that opens a xls file, grabs some data from it, opens another file, puts the collected data in it, then finally shows the last file, post-modifications, to the user. Its working beautifully thus far. As crossover maps the linux root ('/') to z:\ you can have your xls files anywhere on your disk and reference it accordingly. In the end, getting it working this way was quite easy, though my crossover didn't like Excel 2003. Works perfectly with Excel 2000 though, macros record and run perfectly, I've got lots of VBA code in one of the xls files, and it works without flaw. When I tried installing Office 2000 premium with the crossover installer, it kept breaking, so I selected the 'install unsupported software' option and let it create a new bottle (win98) for office, this worked perfectly and I followed it with the windows ruby installer (which took ages but executed without error), which I installed into the same bottle as office. Anyway, just thought I'd share this in case someone else out there felt similarly irritated by having to boot in windows every now and then and wished there was an alternative. Cheery-o Gustav Paul