Clear Filters
Clear Filters

Beginners Guide to Excel Link?

5 views (last 30 days)
Jeremy on 28 Feb 2012
Looking for a good source to get started using Excellink. I currently have a "simulation" that runs in Excel VBA (at the time it was the only numerical solver I had access to). Part of the simulation requires running a binary integer programming problem. Excel Solver can take literally hours to do this for large data sets. Rather than reqriting the whole thing, I'd like to simply modify my existing code to call bintprog() and get the resulting vector back. I've never used Excel Link and was wondering if anyone could recommend a good beginner's guide, preferably with some examples similar my situation...i.e. having the VBA call a Matlab function and get the result back for further VBA processing. Thanks!

Answers (1)

Jiro Doke
Jiro Doke on 28 Feb 2012
Have you gone through the documentation for Excel Link (or Spreadsheet Link EX)? It has several examples, including writing VBA code to call MATLAB.
  1 Comment
Jeremy on 28 Feb 2012
I found a couple of examples in the documentation of fairly basic operations. What I gather is that you mainly use
MLEvalString("<whatever you would type in MATLAB>")
So in my case, MLEvalString("x=bintprog(f,A,b)") assuming I had used MLPutVar to populate f, A, and B. It's not made explicitly clear, but I assume the VBA execution pauses until the MatLab execution completes? For large sizes, bintprog can still take 15-20 seconds to execute.

Sign in to comment.


Find more on Data Export to MATLAB in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!