Sorry to confused you but the 1st code gives the the undefine value error and the 2nd one gave me the Win32::OLE=Hash(0x1832544) but I want the actual text or name of the worksheet. Thanks for your input.. I ran your File::Spec code and it gave me the same undefine value error as my 1st set of code.