From: Martin DeMello Date: 2006-12-04T00:46:10+09:00 Subject: Re: How to get the values for Excel constants at once On 12/3/06, chen li wrote: > > 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? Use const_get - it's a method defined on Module. Excel_Const.constants.sort.each{|i| puts "The value of Excel_Const::#{i} is "+Excel_Const.const_get(i) } martin