Path: news.mathworks.com!not-for-mail
From: "Isaac " <asimov4000@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem with xlswrite1
Date: Tue, 3 Nov 2009 10:18:03 +0000 (UTC)
Organization: Asimov Fin
Lines: 34
Message-ID: <hcp00q$cfj$1@fred.mathworks.com>
References: <hcmj12$392$1@fred.mathworks.com> <dd23afb5-e324-4eb4-bbf8-e9f72ab20b30@m38g2000yqd.googlegroups.com>
Reply-To: "Isaac " <asimov4000@hotmail.com>
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 1257243483 12787 172.30.248.38 (3 Nov 2009 10:18:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 10:18:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1380234
Xref: news.mathworks.com comp.soft-sys.matlab:581998


ImageAnalyst <imageanalyst@mailinator.com> wrote in message <dd23afb5-e324-4eb4-bbf8-e9f72ab20b30@m38g2000yqd.googlegroups.com>...
> 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

hi Image :)
yes i have excel installed...
but also the instruction Excel = actxserver('Excel.Application'); gives me error :(((