Hi and welcome to ExcelForum,
Thank you for using CODE TAGS.
Chances are there is a missing VBA reference to one of the basic VBA runtime libraries. Chip Pearson references 5 basic librararies, which are the only ones I have loaded on my Excel 2003 computer, and your code compiles and runs on my machine if I use
'c:\Windows\system32\Write.exe'.
For Chip's list of the libraries see: http://www.cpearson.com/excel/missingreferences.aspx
Lewis
Bookmarks