1. From what application are you running the VBA code?
2. Does this happen with any Office file you test or just an Excel file? If it's just an Excel file, is it only this one file that you are having trouble with or does the same happen with all Excel files?