View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Run MS Excel macro

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 3 ratings Rate this file 10 Downloads (last 30 days) File Size: 3.5 KB File ID: #42063 Version: 1.0
image thumbnail

Run MS Excel macro



Run MS Excel macro with or without parameters

| Watch this File

File Information

Run MS Excel macro


- XLSFILE: name of the XLS-file
- MACRO: macro name
- PARAMS: parameters for the MACRO

- XLSFILE will be edited

- In some cases when an error occurs, MS Excel must be manually closed (in Task Manager for Windows systems)
- Some macros do not run if the visibility of MS Excel is off. So it is on by default.


Check If Xls File Is Open And Close It inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Other requirements MS Excel
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
26 May 2016 Eddy Barratt

Very helpful, and it works well. I made a slight edit to make the set(Excel, 'Visible',1) line optional, as the macro seemed to work fine without it for me. I then run it in a try-catch loop and turn visible on if I have an error.

26 May 2016 Eddy Barratt  
17 Oct 2014 Santiago

Thanks! Found it very useful!

Contact us