Hello Silver,

The errors indicate to me that you are attempting to run this code on a Mac. This code will not run a Mac. The Mac does not support Windows API calls.

If you are running this on a PC then I have no idea what the problem is. Both codes work fine on my PC which is running Windows 7 with Office 2010.