Where are you calling the code from? If you call it from a differentworkbook, you'll need to qualify the reference.