VBA from MS Outlook to copy data from excel file and past it to email body

mrMadCat

New Member
Joined
Jun 8, 2016
Messages
39
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hi!

I have excel file which is saved locally in OneDrive folder but is shared within office 365 so can't use VBA.
So I need to run a macro from MS Outlook to copy data from the excel file and past it in the new email's body.
Here is the whole routine I want to automate:
1) Open the excel file
2) In the filter of the B column unselect "0" and empty cells
3) Select and copy filtered predefined range
4) Start new email with specified topic and contacts
5) past the previously copied data into the email's body as a table leaving the original formatting

Don't want to code this from scratch. Maybe you can point me to some similar examples I can use as a base.
Thank you.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Seems like we've got a lot in common; I don't want to code that from scratch for you either. That's a rather bespoke automation process you've outlined there, so I suspect that you'll need to break it down into its constituent components.

For item 1 ("open the excel file), check out this link.
For items 2 and 3, the answer by Scott should be helpful in terms of selecting non-blank cells: link.
For item 4, use the method at this link.
Finally, the answer for item 5 is amongst the answers here: link

Enjoy!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top