Difference between revisions of "Ruby - Excel Constants"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (Created page with '=Example= <pre> require 'win32ole' module ExcelConsts end excel = WIN32OLE.new("Excel.Application") WIN32OLE.const_load(excel, ExcelConsts) excel.quit() puts 'Matches for: ' ...') |
(No difference)
|
Revision as of 10:16, 12 March 2010
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?
}