Ruby - Excel Constants
Revision as of 10:22, 12 March 2010 by PeterHarding (talk | contribs)
Example
require 'win32ole' module ExcelConsts end excel = WIN32OLE.new("Excel.Application") WIN32OLE.const_load(excel, ExcelConsts) excel.quit() puts 'Matches for: ' + ARGV[0] ExcelConsts.constants.each {|const| match = const.match(/#{ARGV[0]}/) value = eval("ExcelConsts::#{const}") puts ' '*4 + const + ' => ' + value.to_s unless match.nil? }