I am using the following code to create a PDF of some search results and then email them:
On the Search Page the user clicks Email Search and a UserForm is opened, allowing the user to enter the email settings (Addresses, Subject, Body etc). When the user selects the Send Email button the settings are saved on the EmailSettings sheet, and the code above is then executed. However Im getting the following error:Please Login or Register to view this content.
Run time error 1004
Method 'Close' of object '_Workbook' failed.
If I run the email code by itself, and enter the data into the EmailSettings sheet manually it works fine, it only fails when ran from the UserForm.
I have attached my workbook.
Bookmarks