From: cristian cristian Date: 2011-12-28T06:15:15+09:00 Subject: Simple CSV and Excel problem. Hello all! Im a real newbie and I have been reading a lot of threads regarding csv and excel but still dont know how to solve my problem. I have a csv file like this: "title1","title2",.... "value1","value2",... "value11","value22",.. The problem: I would like to import this csv to an excel workbook. Later on work with the cells but thats another issue. Right now I would like to start with just import the csv. So in my mind the solution should be something like this: require 'win32ole' excel = WIN32OLE::new('excel.Application') excel.visible=1 wb = excel.Workbooks.Add() ws = wb.Worksheets(1) # Now an excel workbook is created and I would like to import the CSV. How? Is there a method or something that can be used? # I made this but dont know what to do for each iteration: def printCSV CSV.foreach(@filename,:headers => true, :quote_char => '"', :col_sep => ',', :row_sep =>:auto) do |row| "This code should write one value to each cell in the row of the worksheet "#puts row[0] end end Is this the best way of solving my problem? Any suggestions are appreciated! Br cristian -- Posted via http://www.ruby-forum.com/.