From: Arup Rakshit Date: 2013-01-28T20:25:01+09:00 Subject: Re: Can we attach documents to excel columns using Ruby? Damián M. González wrote in post #1093726: >> OMG!! Excellent reference you have provided. `+1` to you. Thank you very >> much. I will sure give it a try,hope what I am looking for ward,surely >> would get from here. >> >> Thanks > > You can be sure that that will work. You can also add colors, format > Can any one help me for the below code, which I draft to meet my above requirement? require 'win32ole' #Excel Application will be started from here. #-------------------------------------------- excel = WIN32OLE.new('Excel.Application') excel.visible = true wb=excel.workbooks.open("E:\\WIPData\\Ruby\\Scripts\\GSL_File_DownLoad1.xlsx") wbs= wb.Worksheets(1) rows=2 column=2 until wbs.cells(rows,1).value == nil do Dir.entries("E:\\WIPData\\Ruby").each do |f| if f == wbs.cells(rows,1).value then column=2 Dir.foreach(f) do |x| full_path=Dir.pwd.concat("/" + f) wbs.cells(rows,column).values = wbs.OLEObjects.Add(,full_path,False,True,,,f,) column = column + 1 end end end end But getting error as : E:\WIPData\Ruby\Scripts>test.rb E:/WIPData/Ruby/Scripts/test.rb:25: syntax error, unexpected ',', expecting ')' ...).values = wbs.OLEObjects.Add(,full_path,False,True,,,f,) ... ^ E:/WIPData/Ruby/Scripts/test.rb:25: syntax error, unexpected ',', expecting '=' ...cts.Add(,full_path,False,True,,,f,) ... ^ E:\WIPData\Ruby\Scripts> -- Posted via http://www.ruby-forum.com/.