0

require "uri"
require "net/http"
require 'HTTParty' 
require 'Nokogiri'
require 'faker'
require 'watir-webdriver'
require 'rubyXL'

@workbook = RubyXL::Parser.parse("02.xlsx")
@worksheet = @workbook[0]
@worksheet.change_row_fill(0, 'FFFF00')
@workbook.write('02.xlsx')

This is my ruby script in which i am highlighting the first row. The problem is that the row is not highlighted when the file is already opened. But when i close the file and open it again the changes are there. Is there workaround to make the changes happen in real time when the file is already opened.

Hassan Abbas
  • 1,166
  • 20
  • 47
  • If the file is already open in Excel then you would need some kind of automation, where your code drives the Excel instance to make the changes. Eg. http://www.codeodor.com/index.cfm/2009/6/9/Automating-Excel-with-Ruby-A-Simple-Example/3030 – Tim Williams Aug 20 '16 at 23:52
  • @TimWilliams can you guide me to a mac example since i am not using windows. – Hassan Abbas Aug 21 '16 at 09:13
  • I'm neither a mac nor a ruby user so I'd just be doing the same Googling you'll need to do. – Tim Williams Aug 21 '16 at 18:26

0 Answers0