Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Matlab to Excel issue
Date: Mon, 24 Sep 2007 23:43:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 54
Message-ID: <fd9i2n$adu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190677399 10686 172.30.248.36 (24 Sep 2007 23:43:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 24 Sep 2007 23:43:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1070623
Xref: news.mathworks.com comp.soft-sys.matlab:430011



I am having this issue in MatLab that I hope I can get help 
on.

Here is my basic M-file program functions:
1. load excel document
2. read specified sheet in excel document
3. save specific [rxc] matrix from excel sheet to a matlab 
variable
4. write [rxc] matrix from matlab variable to a specified 
region of same excel document

(if anybody needs further details (i.e. calls used, cmds 
used&#8230;) on this process, let me know and I will surely 
provide them)

The issue is this.  When I run my code, the program takes a 
while to process everything.  And usually the matrices that 
I work with in MatLab are on the order of [384x7] in size.  
My code works, because I have seen the results saved in 
MatLab.  However the warning that I always get when the 
program is around 2/3 complete is:

Warning: could not start Excel server for export.
XLSWRITE attempts to file in CSV format.

> In xlswrite at 157
> In det_update_decision at 141

(NOTE: 'det_update_decision' is the m-file I wrote, and 
line 141 only containes the cmd 'end'.)

I feel that this is an Excel memory-related issue.  
Everytime I run my program and it stops due to the above 
error, I check the task manager and there are several (>30) 
instances of EXCEL.EXE*32's running each taking up ~20,000K 
of space in Mem Usage.

Does anybody know what is causing this?  And if so, how to 
remedy it?

One thing that I tried to do was use the following:

Excel = activexsrv('Excel.Application') to start up an 
activexsrv for Excel, and use Excel.Quit at the end of the 
code so that I do not have recurring instances of Excel 
open in the Task Manager.  Is this the correct way to go 
about it?

Thanks!
m.k.