help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create an XLSX suing the OCT interface


From: Philip Nienhuis
Subject: Re: Create an XLSX suing the OCT interface
Date: Wed, 29 Oct 2014 10:39:12 -0700 (PDT)

ijourneaux wrote
> Thanks Philip
> 
> I had tried switching to the OCT interface because of a problem I was
> having saving the XLSX files. So, for the time being, I decided to go back
> to the COM interface which is what I have been using for ever.
> 
> That produced the following messages
> 
>>> xlh=xlsopen('c:/temp/test.xlsx',1,'COM');
> Creating file c:/temp/test.xlsx
>>> [xlh rs] = oct2xls('Test', xlh, 'testID', 'A1');
> (oct2xls: input character array converted to 1x1 cell)
>>> xlh=xlsclose(xlh);
> warning: xlsclose: file c:/temp/test.xlsx could not be saved. Read-only or
> in use elsewhere?
> 
> (File pointer preserved. Try saving again later...)
>>>
> 
> No file is saved and a copy of Excel is left running in the task manager 
> 
> This seemed similar to a probalby a had a few months ago as discussed in
> this thread
> https://lists.gnu.org/archive/html/help-octave/2014-08/msg00108.html
> <https://lists.gnu.org/archive/html/help-octave/2014-08/msg00108.html>  
> 
> At the time, I was unable to write an xlsx file to any of the local drives
> on the computer I was setting up. After much troubleshooting I figured out
> that I could write to a network drive so I just installed the scripts to a
> folder on the network drive and problems solved. I was never able to
> explain why I could not save to a local drive or folder.
> 
> So this suddenly happened to my development computer where suddenly I can
> no longer save files to my local hard drive. This has worked for year. As
> in the last episode, I can save files to a network drive. This is not a
> solution this time around.
> 
> Interestingly, from within Excel I can save to the same folders without
> any problems 
> 
> This is probably not directly related to octave but would appreciate any
> thoughts.

Disk full? is your dev PC attached to some network (with silently imposed IT
dept. policies)? does the test.xlsx file already exist? If yes, is it still
connected to / in use by some other process?

If xlsclose says that the filepointer is kept, it means that the file isn't
closed and all data + structures are still in Octave's memory chunk, and for
the COM interface it also means that Excel is still running. It must be,
otherwise it cannot be used to write the file out to disk. That does match
your observation that Excel is still silently running.

So, change the name in the xlh file pointer and try again:

xlh.filename =
</some/other/location/where/you/do/have/guaranteed/write/access/test.xls> 
## thumb drive?
xlh = xlsclose (xlh)

and if you get no more warning/error messages, Excel will be closed and the
file written to disk.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Create-an-XLSX-suing-the-OCT-interface-tp4667144p4667154.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]