Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p9g2000vbl.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Write2Excel error message
Date: Thu, 24 Sep 2009 15:55:31 -0700 (PDT)
Organization: http://groups.google.com
Lines: 52
Message-ID: <c66c0536-b81b-40d9-8ec4-1bce6750d385@p9g2000vbl.googlegroups.com>
References: <h9gl9i$m6m$1@fred.mathworks.com>
NNTP-Posting-Host: 75.186.70.56
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1253832932 11804 127.0.0.1 (24 Sep 2009 22:55:32 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 24 Sep 2009 22:55:32 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p9g2000vbl.googlegroups.com; posting-host=75.186.70.56; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022; AskTB5.5),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:572764


On Sep 24, 4:37 pm, "Pete sherer" <t...@abg.com> wrote:
> Somehow I got the error message:
>
> Write2Excel( fileName, 0, 'sheetname', sheet, ...
>                 'A1',  {hurrName}, ...
>                 'A15', tbl_1, ...
>                 'A30', tbl_2, ...
>                 'A46', tbl_3, ...
>                 'A62', tbl_4, ...
>                 'A78', tbl_5, ...
>                 'A95', tbl_6, ...
>                 'A111',tbl_7, ...
>                 'D9',  tbl_8 );
>
> ??? Error using ==> Write2Excel at 157
> Sorry...unable to open file ./output/loss_summary.xlsx
>
> File does exist, so I don't know what the error was for.
>
> exist( './output/loss_summary.xlsx')
> ans =
>      2
>
> I would appreciate if someone can help me with this issue. Currently I am using XLSWRITE, but it doesn't allow multiple cell writing.  Thanks,
>
> xlswrite(fileName, {hurrName}, sheet, 'A1')
> xlswrite(fileName, tbl_1, sheet, 'A15');
> xlswrite(fileName, tbl_2, sheet, 'A30');
> xlswrite(fileName, tbl_3, sheet, 'A46');
> xlswrite(fileName, tbl_4, sheet, 'A62');
> xlswrite(fileName, tbl_5, sheet, 'A78');
> xlswrite(fileName, tbl_6, sheet, 'A95');
> xlswrite(fileName, tbl_7, sheet, 'A111');
> xlswrite(fileName, tbl_8, sheet, 'D9');

---------------------------------------------------------
I don't know - I use xlswrite1 from the File Exhange, which WILL allow
multiple pokes without relaunching Excel each time.
It looks like there's something wrong with the filename perhaps.  Can
you do just a simple file write with that same filename using fopen()
or csvwrite()?  Maybe it doesn't like the dot.  Maybe you can try to
fix up the name using fullfile() and fileparts().  You say the file
exists.  Is it already open in Excel?  Are you sure?  Better check by
looking at the process list in case it's hidden or acting as a server
(in Windows, type control-shift-esc).  If Excel has it open, you can't
open it again and will get an error.  Do you get the error the very
first time you try the code after you launch MATLAB?  Did you abort a
write in the middle of it by typing control-C perhaps and leaving
Excel alive and hidden as a server in the background with a lock on
that file?
Just some things to think about..............