From: chen li Date: 2006-12-04T00:36:28+09:00 Subject: How to get the values for Excel constants at once Hi all, Thank you in advance for any feedback. I need to print out the values for Excel constants. But the code I use just print the constant's name. The only way I can get the values for constants is to print them one by one. What is the Ruby way to do it? Li ## require 'win32ole' class Excel_Const end excel=WIN32OLE.new('Excel.Application') WIN32OLE.const_load(excel, Excel_Const) #puts Excel_Const.constants.sort Excel_Const.constants.sort.each{|i| puts i} puts puts "This is the value" puts Excel_Const::XlFullPage ##output CONSTANTS Xl24HourClock ... XlYes XlZero This is the value 3 >Exit code: 0 ____________________________________________________________________________________ Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.