Thread Subject: Calling Excel macro commands from Matlab

Subject: Calling Excel macro commands from Matlab

From: Conrad

Date: 15 Sep, 2009 16:39:02

Message: 1 of 2

Hi, I have the following excel Macro:
    Range("F1:F18").Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
It basically draws 2 vertical lines in a table.

I am aware that it's possible to run an excel macro from within Matlab but can I use Matlab commands to draw these vertical lines without having to call a macro?

Thanks for your help!

Subject: Calling Excel macro commands from Matlab

From: Rune Allnor

Date: 15 Sep, 2009 16:51:34

Message: 2 of 2

On 15 Sep, 18:39, "Conrad " <conr...@gmx.net> wrote:
> Hi, I have the following excel Macro:
>     Range("F1:F18").Select
>     With Selection.Borders(xlEdgeLeft)
>         .LineStyle = xlContinuous
>         .Weight = xlThin
>         .ColorIndex = xlAutomatic
>     End With
>     With Selection.Borders(xlEdgeRight)
>         .LineStyle = xlContinuous
>         .Weight = xlThin
>         .ColorIndex = xlAutomatic
>     End With
> It basically draws 2 vertical lines in a table.
>
> I am aware that it's possible to run an excel macro from within Matlab but can I use Matlab commands to draw these vertical lines without having to call a macro?

Well... don't know if this qualifies as 'matlab commands',
but you can use matlab to issue commands to excel to do what
you want.

The problem is how to map the commands in the VBA macro over
to something that cam be issued to excel from matlab via the
COM interface.

Rune

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
excel Sprinceana 15 Sep, 2009 14:10:28
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com