In this tutorial we learn how to open Excel by macro written in Microsoft Outlook. Outlook is used as an email client, but gives more functionality to developers. Outlook is otherwise generally used to check emails, calendars, and work with contacts.
Step # 1 – Enabling developer
To access the macros section, we need to navigate to the “developer” tab in the ribbon bar. By default this tab is not visible to most users. It can be turned on by navigating to the “file” tab, then clicking the “options” button.
This will open up a new popup window. There we have to select the customize ribbon option, and lastly tick the “developer” check box listed on the right column of the window.
After that close the popup window and the developer tab will appear.
Step # 2 – Create macro
Now navigate to the developer tab and locate the macros drop down button. Then click the macros button in the drop down menu and open a macros list. Here we can create, edit, run, and delete macros. Let’s name our excel macro as “OpenExcel” and select create.
Step # 3 – Visual basic Editor
The macro now needs to be defined, and for that Outlook has opened a Visual Basic editor with an empty sub routine defined in the name of the macro. We will use the shell function to open Excel. The function requires a path to the file in order to locate and open the program executable. Once the sub routine has the shell function ready, we can extend the sub routine with any other task we wish for or just save it.
And this was how we can use excel macro for outlook.