Code covered by the BSD License  

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

» Watch video

Highlights from
Run MS Excel macro

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

Run MS Excel macro

by

 

Run MS Excel macro with or without parameters

| Watch this File

File Information
Description

Run MS Excel macro

USAGE
xls_run_macro(xlsfile,macro)
xls_run_macro(xlsfile,macro,params)

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

OUTPUT
- XLSFILE will be edited

N.B.
- 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.

Acknowledgements

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