Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m38g2000yqd.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem with xlswrite1
Date: Mon, 2 Nov 2009 06:02:24 -0800 (PST)
Organization: http://groups.google.com
Lines: 30
Message-ID: <dd23afb5-e324-4eb4-bbf8-e9f72ab20b30@m38g2000yqd.googlegroups.com>
References: <hcmj12$392$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1257170544 20223 127.0.0.1 (2 Nov 2009 14:02:24 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 2 Nov 2009 14:02:24 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m38g2000yqd.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	CyberSafe-IWA-Enable; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; 
	.NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 
	3.5.30729),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:581823


Are you sure you have Excel installed?
If so, here is the code I use to startup excel, use xlswrite1(), and
shutdown Excel:

			%----- Open Excel for writing.
			Excel = actxserver('Excel.Application');
			if ~exist(excelFileName, 'file')
				ExcelWorkbook = Excel.workbooks.Add;
				ExcelWorkbook.SaveAs(excelFileName, 1);
				ExcelWorkbook.Close(false);
			end
			Excel.Visible = true;	% Make Excel visible.
			% Open up workbook.
			invoke(Excel.Workbooks, 'Open', excelFileName);
			% Save the reference to this workbook so that we can later activate
it, in case we open multiple workbooks.
			%wbNumber1 = Excel.ActiveWorkbook;

			% Do the actual writing of the data to the open worksheet.
			xlswrite1(excelFileName, dataArray, 'MySheetname', 'C3');

			invoke(Excel.ActiveWorkbook,'Save'); % Save to disk.

			% Shut down Excel.
			Excel.Quit
			Excel.delete
			clear Excel;  % Remove variable from workspace.
Good luck,
ImageAnalyst