I am trying to use a macro to email a recipient. I only want the active sheet in a workbook to be sent. I am using outlook express. Help is appreciated.
I am trying to use a macro to email a recipient. I only want the active sheet in a workbook to be sent. I am using outlook express. Help is appreciated.
Hello Khaos176,
To do this it would be better if you have Outlook. However an attachment can be sent using Outlook Express with some rather complicated code. You have to supply the email address, subject, and message (body) to the macro from VBA.
Adding the MacroPlease Login or Register to view this content.
1. Copy the macro above pressing the keys CTRL+C
2. Open your workbook
3. Press the keys ALT+F11 to open the Visual Basic Editor
4. Press the keys ALT+I to activate the Insert menu
5. Press M to insert a Standard Module
6. Paste the code by pressing the keys CTRL+V
7. Make any custom changes to the macro if needed at this time.
8. Save the Macro by pressing the keys CTRL+S
9. Press the keys ALT+Q to exit the Editor, and return to Excel.
Sincerely,
Leith Ross
I am using code written by Leith Ross. It works fine in Outlook 2003 but I need it to use outlook express. I replace the "Outlook .Application" with "MSIMN.Application" but it does not work.
'Written: October 18, 2008
'Author: Leith Ross
'Summary: Send active worksheet as an attached file.
Please Login or Register to view this content.
Last edited by Leith Ross; 10-30-2008 at 03:38 PM. Reason: Added code tags
Hello Khaos176,
Your solution has been posted.
Sincerely,
Leith Ross
Sorry about the last post. I was typing it while you were sending
I cant seem to figure out how i would run this macro
Hello Khaos176,
You have to run it from another macro. Where is the information on the worksheet? I can change the macro to use those cells. You can then attach the macro to a button or use ALT+F8 to run it.
Sincerely,
Leith Ross
I tried to add this code to a command button. It gives me a compile error "Only comments may appear after End Sub, End Function, or End Property". If this helps the cells that I am using for the email are located in the following - Recipient = CoverSheet C11 (This is the worksheet I would like to send), Subject = ("DataStorage!P6"). Also the recipient is only a name, I want Outlook to find the correct email address in the address book for the contact. Thank you so much!
Hello Khaos176,
Although Outlook Express has an address book, the application doesn't allow VBA to access it. Outlook does allow VBA to access the address book and can even resolve names. Why are you not wanting do this Outlook? If you have Office you have Outlook. If you are concerned that the recipients won't be able to receive it, they will. Your email is plain text. All email programs handle plain text.
Sincerely,
Leith Ross
I am using express only because that is what my company is using. So in trying to keep it simple for them i am trying to get this to work. I might talk them into switching if needed. The problem i am having is that when I press ALT F8 to go to the macros the macro is not there. I dont understand what i need to do to run it.
Hello Khaos176,
You're right to keep it simple. If your company is using Outlook Express then that is what we will have to use. I will rework the macro to launch Outlook Express. Currently, it launches whatever you computer system's default email client is set to. I will write so that the active sheet is emailed when you run the macro from ALT+F8 or a button, etc.
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks