[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Fetch an excel sheet name in ruby

Deepa Rajendran

2/24/2009 4:58:00 AM

Hai friends,
How to fetch an excel sheet name in ruby...
--
Posted via http://www.ruby-....

4 Answers

Daniel Berger

2/24/2009 5:06:00 AM

0

Deepa Rajendran wrote:
> Hai friends,
> How to fetch an excel sheet name in ruby...

gem install spreadsheet

Regards,

Dan


Deepa Rajendran

2/24/2009 6:05:00 AM

0

Dan,
Thanks......
I installed spreadsheet. My concept is.
I download the .xls attachment file from my inbox,but i need to fetch
the excel sheet name through ruby coding.Could you plz help me.
--
Posted via http://www.ruby-....

Heesob Park

2/24/2009 7:12:00 AM

0

2009/2/24 Deepa Rajendran <deeparaj12@gmail.com>:
> Hai friends,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0How to fetch an excel sheet name in rub=
y...

You can do it using win32ole like this:

require 'win32ole'

xl =3D WIN32OLE.new('Excel.Application')
wb =3D xl.Workbooks.Open("c:/work/test.xls")
ws =3D wb.Worksheets(1)
puts ws.Name
wb.Close
xl.Quit


Regards,

Park Heesob

Hannes Wyss

2/24/2009 8:16:00 AM

0

On Tue, Feb 24, 2009 at 8:11 AM, Heesob Park <phasis@gmail.com> wrote:
> 2009/2/24 Deepa Rajendran <deeparaj12@gmail.com>:
>> Hai friends,
>> =A0 =A0 =A0 =A0 =A0How to fetch an excel sheet name in ruby...
>
> You can do it using win32ole like this:
>
> require 'win32ole'
>
> xl =3D WIN32OLE.new('Excel.Application')
> wb =3D xl.Workbooks.Open("c:/work/test.xls")
> ws =3D wb.Worksheets(1)
> puts ws.Name
> wb.Close
> xl.Quit


... and in Spreadsheet:

book =3D Spreadsheet.open("/path/to/xls")
sheet =3D book.worksheets.first
puts sheet.name


see also:
http://spreadsheet.rub...
http://spreadsheet.rub.../files/GUIDE_txt.html
http://spreadsheet.rub.../classes/Spreadsheet/Worksheet.html

hth

cheers,
Hannes