I am not running a script; just running the macro manually from the project explorer The macro completes but nothing happens. How does the CopyToExcel macro know the Outlook inbox to use?
I had already replaced Sub CopyToExcel(olItem As Outlook.MailItem)
with Sub CopyToExcel() and Dim olItem As Outlook.MailItem
I had not added this line as instructed.
Set olItem = Application.ActiveExplorer().Selection(1)
The macro knows runs without error, but it just open excel with no file...
Thank you for your quick reply. Yes, I am using "Use a macro to copy data in Outlook email to Excel workbook"
and the Dim section has: Dim sText As String.
This macro is exactly what I am need, but it produces a run-time error '91': Object variable or With block variable not set
The error occurs on line sText = olItem.body
I am new to VBA for Outlook and do not know how to correct the error. Thanks for any help provided.