greg.kujawa
8/9/2007 12:37:00 AM
On Aug 8, 2:08 pm, "alexeyomux" <alexeyo...@yahoo.com.cn> wrote:
> <<Programming Ruby 2nd>> teaches me how to create a new Excel file and add
> something to it, but now I have a task that there were some existing Excel
> files with data, what should I do is opening the files one by one and read
> the data for doing something.
> I try to use the WIN32OLE .connect() function, but it didn't work.
> Is there other better way to do so?
> thanks a lot!
What the other posters suggested are great tips. Personally I have
been able to leverage a lot of great time savers using Ruby's WIN32OLE
and Excel. For example, reading lots of SQL data sets and pumping them
into new Excel worksheets, reading and modifying existing Excel
spreadsheets, etc. One recent project involved taking an SQL query
script and exporting the results to Excel. From there that Excel file
served as the data source for a Word mail merge. Automated all to the
point of a scheduled job that automatically runs each reporting
period. Good stuff for sure. And a heck of a lot less code and effort
than doing the same thing in VB, C#, etc.