From: Arup Rakshit Date: 2013-01-24T22:58:17+09:00 Subject: Re: Reading and looping through Excel Joel Pearson wrote in post #1093501: > Here's something to get you started, connecting to excel... after that > you can just use the API to excel's functions (record a macro, and check > out the functions it uses when you do stuff). > > Caveat Lector: Some of the lines have been squashed into multiple lines > by the width restrictions. > > FYI I used tab-delimited as I find commas too common. > > _______________________________ > require 'win32ole' > > begin > excel = WIN32OLE.connect('excel.application') > rescue > excel = WIN32OLE.new('excel.application') > end > > Why the above style? asking just for curiosity. Why "connect"? > > wb.Close(0) > excel.Quit unless excel.visible what the command 'unless excel.visible' does? And why 'wb. close(0)' instead 'wb.Close()'? -- Posted via http://www.ruby-forum.com/.