Running a macro

Overview

The run macro instruction allows a user to run a macro within an Excel workbook.

For the purposes of this article we are going to use a simple and fictitious Excel file. It has already been uploaded into a data step. You will want to replace this file with one of your own.

Before we get started

Please further create a ‘Manipulate a file’ or ‘Multiple file manipulations’ action step so that you can add and use instructions.

The target file contains a macro named “ClearSheet” that when run, clears everything from Sheet1. The file resembles the image below:

For those familiar with VBA, the macro runs the following code:

Steps

1. Create a ‘Run macro’ instruction.

2. Link the file named “Target” as the target file.

3. Select Sheet1.

4. In the Macro Name field, type “ClearSheet”. This is the macro that the instruction will run.

6. Save and run the step.

7. After the step finishes running, download and open the target file. It should resemble the following image:

Leave a Reply

Latest Tweets

Free eBook: 10 Tips for sourcing good data yucalc.com/2017/02/17/fre…

reply · retweet · favorite

Newsletter

By signing up, you agree to our Terms of Service and Privacy Policy.

Address

Suite 1506, Westfield Tower 2, 101 Grafton St Bondi Junction NSW 2022 Australia

View Larger Map

Contact Us

AUS: +61-2-9386-0202
UK: +44-20-8123-1251
Send us an email

ContactUs.com
WordPress Image Lightbox