S
saudaziz
I am trying to read entire row (with as many non-null columns are
present) into data variable from excel sheet, but the following code
only appears to read data for first 4 columns. Am i doing something
wrong? How can i make it read it x number of columns instead of just 4.
def getExcelStuff
excel = WIN32OLE::new('excel.Application')
workbook =
excel.Workbooks.Open('C:\ruby\watir\watir-v1_4\examples\logging\POPbugs.xls')
worksheet = workbook.Worksheets(1)
worksheet.Select
excel['Visible'] = true
line = '1'
data = []
while worksheet.Range("a#{line}")['Value']
data << worksheet.Range("a#{line}:d#{line}")['Value']
line.succ!
end
data.each { |x| print x, "\n\n\n" }
#0.upto(9) do |x|
# $logger.log( x "\n" )
#end
end
present) into data variable from excel sheet, but the following code
only appears to read data for first 4 columns. Am i doing something
wrong? How can i make it read it x number of columns instead of just 4.
def getExcelStuff
excel = WIN32OLE::new('excel.Application')
workbook =
excel.Workbooks.Open('C:\ruby\watir\watir-v1_4\examples\logging\POPbugs.xls')
worksheet = workbook.Worksheets(1)
worksheet.Select
excel['Visible'] = true
line = '1'
data = []
while worksheet.Range("a#{line}")['Value']
data << worksheet.Range("a#{line}:d#{line}")['Value']
line.succ!
end
data.each { |x| print x, "\n\n\n" }
#0.upto(9) do |x|
# $logger.log( x "\n" )
#end
end