Path: news.mathworks.com!not-for-mail
From: "Yair Altman" <altmanyDEL@gmailDEL.comDEL>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using named arguments in Matlab COM client interface Excel
Date: Tue, 29 May 2012 23:29:07 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 22
Message-ID: <jq3m43$rco$1@newscl01ah.mathworks.com>
References: <6566404e-fd0f-4767-85fb-f2d9e57a71b2@s6g2000pbi.googlegroups.com> <3e089eb4-5ac5-4139-a813-1a2a91045838@pr3g2000pbb.googlegroups.com>
Reply-To: "Yair Altman" <altmanyDEL@gmailDEL.comDEL>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1338334147 28056 172.30.248.46 (29 May 2012 23:29:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 May 2012 23:29:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:769381

Paul <paul.domaskis@gmail.com> wrote in message <3e089eb4-5ac5-4139-a813-1a2a91045838@pr3g2000pbb.googlegroups.com>...
> Paul wrote:
> > Some of the Excel methods (e.g. Sheets.Add) take named arguments.
> > How can I do this from the Matlab COM client interface?
> 
> I forgot to mention that as of 1998, there was no solution:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/6791
> 
> Hopefully, things have changed.

It's not necessarily that there was no solution since 1998. It could be that back in '98 nobody who knew the answer saw the newsgroup thread and/or bothered to answer. And of course nobody who has a life searches for 14 year-old unanswered threads to answer. 

As for my small contribution to this issue, AFAIK there are no named parameters in COM. However, you can often rely on the parameter order and pass [] (empty brackets) to any non-specified parameter. For example:
   expression.Add([], 'AfterName', ...)
I'm not sure it will help your specific case, but it's worth a try.

Also see the following related article:
http://undocumentedmatlab.com/blog/com-activex-tips/

Yair Altman 
http;//UndocumentedMatlab.com