The code cannot work in Outlook... and your post is a little lacking in detail.
The first question is have you set a reference to the Excel Object model using the Tools/References menu?
Then what you have to do is declare an object either as a generic object or as 'Excel.Application' depending on the answer to the first question (declared as 'Something').
You than need to get a reference to a running instance of Excel. If that succeeds you then loop through the workbooks but change the 'Application' to 'Something' in the'For' line. Application refers to the application running the code, which is Outlook and Outlook does not have a Workbooks collection. Not forgetting this will require some error handling code, and not just
General answer, reflects the level of detail in your post.
Bookmarks