Four questions
1. What version of Excel are you using?
2. What references are set (in the VBE look at tools/references and see what
is ticked)
3. Where is the sub. (This Worksheet, This Workbook, Module 1, etc.)
4. Are you running the macro from an open workbook or from the VBE; Is there
a workbook oppen at the time?