Do you have an Excel report or graphs that need to be emailed to various people every month? We can use Excel automation features to do this task quite easily.
The inspiration – A client request for Excel Email Solution
The idea for this came from a recent project I did for a client. They wanted me to build an Excel workbook which shows latest sales summary and then allows them to email the snapshot to the relevant people in one click.
Here is a snapshot of the solution I created for them (with dummy data):

- You select a product and see the dynamic report
- Pick the person who will receive the report (from drop-down list)
- Click on the “Send email” button to send the email
The ingredients – What we need
Here, I am using 3 main ingredients.
- A report created in Excel 365
- Office Scripts to generate the email contents and trigger the mail process
- Power Automate flow to send the email
Below is a schematic of the whole process.

The Recipe – How to send emails from Excel
The actual recipe is a bit detailed and harder to explain in text only format. So I made a video with the whole thing. Watch it here or on my YouTube channel. I have included the key steps as text below too.
Scripts & Instructions:
We can send either text or images as the email. In our case, I have both text content and images. The images come from a grouped object named Group 5.
GenerateReport Script:
Go to your “Automate” ribbon in Excel and click on “New Script” button.

In the script window, paste below script and customize the names as needed (refer to the video for explanation on the script).
function main(workbook: ExcelScript.Workbook):myOutput {
// Your code here
let ws = workbook.getWorksheet("Report");
let repGroup = ws.getShape("Group 5");
const repImage = repGroup.getImageAsBase64(ExcelScript.PictureFormat.png);
const emailSubject = ws.getRange("c2").getText();
const sendTo = ws.getRange("I22").getText();
console.log(emailSubject);
console.log(sendTo);
return {repImage,emailSubject,sendTo};
}
interface myOutput {
repImage: string;
emailSubject: string;
sendTo: string;
}
Set up the Power Automate Flow
- Go to Power Automate website and login with your credentials
- Create a new instant cloud flow
- Set the trigger as “When HTTP request is received”
- Add “Run Script” step in Excel
- Add Send an email (v2) step
- Set up the flow as depicted below.
Obtain the Trigger URL
- Save your flow
- Now go back the “trigger” step (step 1 of your flow)
- Make sure you set the method to GET
- Expand and copy the URL.
Back to Excel to make one more Script
We are nearly done. We just need to add one more script & a button in our sales report so that we can initiate the flow from Excel.
Add one more script in Excel and use the below code.
function main(workbook: ExcelScript.Workbook) {
// Your code here
const triggerURL = "___YOUR TRIGGER URL___";
let request = new XMLHttpRequest();
request.open("GET", triggerURL, false);
request.send(null);
}
- Save your script.
- From “Code Editor” click on the options menu for your script and use the “Add Button” to add a button on Excel worksheet.
- Whenever you click on this button, your flow will start.
Other ways to Automate this:
We can also use VBA to create & send emails automatically. I have previously written about that approach too. Read this article for VBA Excel Email Sender.
VBA vs. Office Script approach – which is better?
Both technologies offer automation. I have summarized the pros & cons of each technology below.
As of 2023 March, my preference is to use VBA for things like Email automation as it is easy to control and deploy.
VBA
VBA Pros:
- Works in any version of Excel
- Easy to learn, easy to code
- Lots of help & resources
- Very old and stable language base
- Works with Excel, Office & Windows Objects & API
VBA Cons:
- Can't use with Web / Mobile version of Excel
- Not easy to integrate with Cloud platforms (Power Automate, Sharepoint etc.)
- Security problems
Office Script
Office Script Pros:
- Works on Web / Mobile versions too
- Integrates with cloud platforms (Power Automate etc.)
- Future ready technology
Office Script Cons:
- No easy help or resources
- Hard language to learn and master
- Doesn't work in older versions of Excel
- Can't use all objects of Excel. Will not work with Windows API etc. too
- Needs costly subscription plans to use
- Runs on server, thus no control and susceptible to downtimes etc.
Thanks to Mark Proctor
I got the idea for URL trigger from Mark Proctor. Thanks Mark for the fantastic work 🙂
Got questions?
Do you have any questions reg. this implementation. Post a comment so that our community can help you.














24 Responses to “10 Supercool UI Improvements in Excel 2010”
The best improvement by far is the Collapse Ribbon ^ button !
Kind of a shame that some of the best improvements are actually returns to old functionality. One thing I don't like is that to get to recent files I need to do an extra click after File - apart from Save As, that's why I'm usually in the File menu. I like the sparkline options, though they are still as not fully featured as some of the free and pay options out there.
The collapse button for the ribbon menu is good news. Can you make the ribbon menus stick too?
Nine improvements, not ten. You can also select multiple objects in 2007. Click on the Find & Select item at the far right of the Home tab, and the dropdown looks remarkably like your 2010 screenshot.
@Jon.. Thank you. Dumb me, I somehow thought we couldnt select objects in Excel 2007. Just saw the "select menu" and it is there. I have corrected the post and removed the point. I have added the "you can make your own ribbons" instead. Thanks once again.
@Arti: what do you mean by make ribbons stick?
@Alex: May be it is my installation, but when I go to "File menu" I see "recent files" by default.
For example, if I am working with one of the contextual ribbon menus (Pivot tables, Drawing/Chart etc), as soon as I click away from the selected object, the menu tabs vanish. If I click on the object again immediately, then Excel will remember what I was looking at, but if I wander away and click on a Pivot, then back again on the Chart, the menus will 'appear' but not get activated, thereby causing much annoyance and additional clicking.
I want to "pin" the whole menu (not invididual commands) somehow, so that I can have the menu there for the length of the time I am working with graphics. Excel 2003 used to have the Drawing toolbar you could detach and hover while you were working, but this functionality disappeared in Excel 2007.
My thought was Excel should just allow a 'pin', similar to the Recently Opened files menu, for the Ribbon Menus as well. If I have not selected any Drawing object, the commands can be greyed out, but I want the menu as a whole to 'stick'.
@Arti... I think MS solved this problem differently. When I select a pivot and go to "design" tab Excel 2010 remembers this and automatically takes me to "design" tab when I reselect the pivot.
Apart from this you can also define your own ribbon with all the things you normally do. See the above article (I have added this after Jon's comments)
Nice feature. About time for a upgrade for MS Office
Oh... okay. That might be a start. I'd probably just copy-paste the Drawing tab haha. Thanks. I'll definitely give Excel 2010 a try.
Btw - have you considered getting into / gotten into the world of Excel as it meets SharePoint?
Actually, the replacement new thing is probably better than all the rest. One thing that the designers of the Office 2007 ignored was allowing regular users to customize their own interface. Office 2010's interface was expanded in this way to address the huge uproar.
Is there still a limit on how many things you can add to the QAT bar? (I'm too lazy to look myself.)
@Jeff.. it seems to take quite a few, but only shows one line and gives a little arrow button at the end. (summary: shucks!)
The best thing is you can edit the ribbon directly from excel, so now i can create my own bar with just the things I use regularly!
One of the annoying things in 07 for me is the Add-Ins menu bar - in 03 I could keystroke directly to menu add ins.. In 07 I needed an extra keystroke just to activate the add-in menu, then the keystrokes as normal.. Hope this marek sense..
John -
If you remember the old Excel 2003 Alt-key shortcuts, you can still use them in 2007. To get to the Add-In dialog:
Alt-T-I
Dear Arti & Chandoo
Seen your comments over some issues. Hope you are form India, gone through your comment expecting a pin to command it as a whole, great, hope if someone out of MS have read it, it may be kept in mind while the next R & D of Office Ver. 16
Just incase someone forgot CTRL+F1 will collapse the ribbon.
[...] was pleasantly surprised when I ran Microsoft Excel 2010 for first time. It felt smooth, fast, responsive and looked great on my [...]
I like the sparklines, and the ability to modify the charts
How do you get rid of the advertisment on the right hand side? If you upgrade then will it take off the ads?
Once again Microsoft has re-decorated the Office and we are NOT pleased!
The graphics object selector can be found in the Home ribbon under Find & Select, Select Objects near the bottom of the drop down. You can make it part of the Quick Access toolbar by right click over it and selecting Add to Quick Access toolbar.
The graphics "cursor" will now appear on the mini-toolbar at the top left of the window.
How to get rid of "Add-Ins" button in Backstage (File)" menu by means of XML code, i.e. to hide, to delete or to disable this button?
This button is usually situated in the Backstage menu between "Help" and "Options" buttons.
Vladimir, did you ever get an answer to your question?
I am tying to customize the ribbon UI for a file using XML, and this is precisely the piece I can't figure out. I can hide other tabs, remove items from QAT and backstage - all except the options that are showing up under add-ins in backstage. If there is an XML syntax for referencing this thing and making it invisible, I cannot find it.
Hey, nice tutorial. Please check my video tutorial on similar topic at the below link and provide your comments:
http://www.youtube.com/watch?v=TeIFc0jYjpA