This you might find helpful http://rubygarden.org/ruby?ScriptingExcel
Also, I was playing around with your script and this worked for me: sheet = application sheet.activecell.offset(1,0).activate --Mark -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Beaton, Malcolm Sent: Wednesday, January 04, 2006 9:15 AM To: [email protected] Subject: [Wtr-general] selecting cells in Excell using activecell Maybe a little out of scope for this group but I am trying to write and retrieve cell data from Excel iteratively with ruby using the activecell property. Only problem is it does not seem to work. My script is basically require 'win32ole' application = WIN32OLE.new('Excel.Application') application.visible = TRUE workbook = application.Workbooks.Add(); worksheet = workbook.Worksheets(1); (1..4).each do |x| dirArray = ['North','South','East','West'] worksheet.Range('A' + (x.to_s)).value = dirArray[(x-1)] end sheet = application.activesheet sheet.activecell.offset(1,0).activate and I always get the error excell.rb:47:in `method_missing': Unknown property or method `activecell' (WIN32OLERuntimeError) Am I missing a lib or something? I can find no reference to other people having this issue Any help would be appreciated Malcolm Beaton _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E [EMAIL PROTECTED] No. 2598884 _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
