Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Using the Microsoft Office Spreadsheet object
Date: Tue, 6 Oct 2009 22:07:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <hagf27$fhi$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254866823 15922 172.30.248.38 (6 Oct 2009 22:07:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 Oct 2009 22:07:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1560446
Xref: news.mathworks.com comp.soft-sys.matlab:575456


Hi,

I'm trying to format an MS-Excel table from within Malab and I'm a bit stuck at the moment. I've managed to create the table using 'OWC11.Spreadsheet.11' and I have populated it. I don't know how to format the table from within Matlab as one would from an excel macro using the following commands:

  Range("A1:V26").Select
  Selection.AutoFormat Format:=xlRangeAutoFormatList1, Number:=True, Font:= _
        True, Alignment:=True, Border:=True, Pattern:=True, Width:=True

I also want to draw some lines between different columns as shown in the following excel macro example:

   Range("B1:B26").Select
   Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
        With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With

Any help on this would be appreciated.Thanks