its because "\\" is not in your string see my post in your other thread

and
String path="C:\Gaurang\ruby\demo.xls"
is not good ruby code because it is interpreted as
String(path="C:\Gaurang\ruby\demo.xls")
with is meanless,use
path =  'C:\Gaurang\ruby\demo.xls'
or
path =  "C:\\Gaurang\\ruby\\demo.xls"

-- 
Posted via http://www.ruby-forum.com/.