Re: [Wtr-general] Reading from excel files (basic)

2007-03-29 Thread Nicola Kennedy
Thanks very much, managed to sort it now. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Reading from excel files (basic)

2007-03-27 Thread sathees
if you are only getting 4 cells, why the array show a long list with nil. your are missing something here. Check your code again! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Reading from excel files (basic)

2007-03-26 Thread Nicola Kennedy
Hi, I am completely new to WATIR, and don't have much programming experience so forgive the simplicity of this question! I am just learning the basics and have created a script that calls an excel file which has a column of web addresses. I have got the scripts to read in the first value from

Re: [Wtr-general] Reading from excel files (basic)

2007-03-26 Thread sathees
$data = [] $data = worksheet.Range('a1:z1')'text' # The data is in cell a1. excel'Visible' = false # hide the spreadsheet from view workbook.close excel.Quit # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data $data.length do |x|

Re: [Wtr-general] Reading from excel files (basic)

2007-03-26 Thread Nicola Kennedy
Hi, Have done this, but am getting error: 1) Error: test_recorded(TC_recorded): NoMethodError: undefined method `length' for nil:NilClass testnic2.rb:50:in `test_recorded' Have copied my script again in case I've done something wrong? excel = WIN32OLE::new('excel.Application')

Re: [Wtr-general] Reading from excel files (basic)

2007-03-26 Thread sathees
try this @mydata = worksheet.Range('a1:a4').value puts @mydata # to c wether the content is in the array. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Reading from excel files (basic)

2007-03-26 Thread Nicola Kennedy
Hi, I did this and the logs showed the websites as follows: www.google.co.uk www.freeuk.com www.bbc.co.uk www.manilow.com nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil The test then just ends, with no errors, but the test doesn't take me to the four

Re: [Wtr-general] Reading from excel files (basic)

2007-03-26 Thread Charley Baker
Hi Nicola, you could try something like this: excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel _testdata2.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet