xlswrite will no longer work on my computer

Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
For whatever reason, I used to be able to export to a excel file but it will no longer work and I keep getting this error message. Nothing has changed, what do I do??

2 comentarios

Geoff Hayes
Geoff Hayes el 7 de Ag. de 2014
Connor, in your previous post can't start excel you mentioned that It used to work now that the computer has been updated i keep getting the same error and I am now using microsoft excel 2010 and matlab R2014a. So what changed in the updated computer - a new version of Excel or ..?
Connor
Connor el 7 de Ag. de 2014
To clarify, the matlab version is the same and so is the Excel. That's why I am confused. The only thing updated was the computer itself. I have been using the xlsappend function that is available in the file exchange to export data to the excel sheet.

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 7 de Ag. de 2014

1 voto

Well something changed didn't it? It no longer runs.
Does Excel itself run? Did you have a trial version of Excel that expired? Do you have a starter version of Excel, which does not allow ActiveX?
Let's see your code for xlswrite.
Do you want to try it via ActiveX instead? Can you run my attached ActiveX demo?

12 comentarios

I tried running your exceldemo and I received
the error message that attached in the screenshot
I checked to see if I have the actxserver function by typing
which actxserver
and I received
'actxserver' not found.
Was this function somehow deleted? if so how do I recover it?
Geoff Hayes
Geoff Hayes el 7 de Ag. de 2014
Do you have a C:\Program Files\MATLAB\R2014a\toolbox\matlab\winfun\ directory on your PC? The path may be slightly different, but the winfun folder is the one that has the actxserver.m file.
Connor
Connor el 7 de Ag. de 2014
I'm in the C:\Program Files\MATLAB\R2014a\toolbox\matlab folder and there is no winfun present, I will try to redownload matlab then
Ok I downloaded matlab again and all files are present. The computer runs windows 7 and has matlab R2014 and microsoft excel 2010. Still the actxserver will not open excel when it tries to, I keep getting the following warning, then error message. FYI, I am using xlsappend which contains xlswrite within it.
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
> In xlsappend at 178
In multiwavelet>perform_wavelet_transform_Callback at 327
In gui_mainfcn at 95
In multiwavelet at 46
In @(hObject,eventdata)multiwavelet('perform_wavelet_transform_Callback',hObject,eventdata,guidata(hObject))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error using xlsappend (line 193)
An error occurred on data export in CSV format.
Error in multiwavelet>perform_wavelet_transform_Callback (line 327)
xlsappend('Exported Data.xlsx',W,'DMEY');
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in multiwavelet (line 46)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)multiwavelet('perform_wavelet_transform_Callback',hObject,eventdata,guidata(hObject))
Caused by:
Error using dlmwrite (line 112)
The input cell array cannot be converted to a matrix.
Error while evaluating uicontrol Callback
Geoff Hayes
Geoff Hayes el 7 de Ag. de 2014
What happens when you re-run the demo?
Connor
Connor el 7 de Ag. de 2014
I ran your demo and it worked. Tried my program, and it worked. I closed out of matlab, re-opened it, tried my program, and I got the error message again. I closed out of matlab once again, tried your program and it worked like a charm. So in conclusion, your program must do something that allows the actxserver to work for my program. Could it be that you use the xlswrite1 and xlsappend uses xlswrite? Is there a way to send my code to either of you guys to take a look at it?
Geoff Hayes
Geoff Hayes el 7 de Ag. de 2014
Editada: Geoff Hayes el 7 de Ag. de 2014
Connor - the demo code was written by Image Analyst, so he will be able to better comment on your question. It is curious how it behaves differently. I know you have shown before that running
Excel = actxserver('Excel.Application')
fails (same command from xlswrite). Is it still the case? Now what about when you run the line from the demo code
Excel = actxGetRunningServer('Excel.Application');
Does it work? (I'm guessing it must since you are able to run the demo!) If it does work, what happens now when you try
Excel = actxserver('Excel.Application')
immediately after? Is running this last statement necessary to getting the other to work?
(I can't test this out since I use a Mac, and my PC has Vista...)
I guess I just have the magic touch. But I'm not doing anything unusual (that I know of) to "fix" the situation. If you don't run my demo, just launch MATLAB, and immediately type
>> which actxserver
C:\Program Files\MATLAB\R2014a\toolbox\matlab\winfun\actxserver.m
and don't see that winfun line, then you need to first check to see if it's on your hard disk. If it is, then the search path in MATLAB is not seeing it for some reason. Perhaps your startup.m has a rmpath() call in it???? Not really sure, but you can call the Matahworks and they'll figure it out.
I added the line
Excel = actxGetRunningServer('Excel.Application');
before the line
Excel = actxserver('Excel.Application')
just as the demo code had it, in a try/catch manner, and it works great now! Thanks for all the help guys!
Image Analyst
Image Analyst el 11 de Ag. de 2014
What's the full code? Is the second line in the catch? But that still doesn't explain why you got the "'actxserver' not found." message.
Maybe, for MATLAB 2014a on this updated computer (@Connor - what version of Windows was the computer updated to?) with Excel 2010, the line
Excel = actxserver('Excel.Application')
does not work unless
Excel = actxGetRunningServer('Excel.Application');
is called first. Given the results that Connor has outlined - the demo works, and then calling his GUI worked wrt xlswrite, but upon restart his GUI would not work wrt xlswrite unless the demo was called first - seems to suggest that there is "something" that calling actxGetRunningServer does that is "needed" to get actxserver('Excel.Application') to work.

Iniciar sesión para comentar.

Más respuestas (1)

azizullah khan
azizullah khan el 7 de Ag. de 2014

0 votos

Use xlwrite Follow these steps: 1. Copy xlwrite code and save it in your current directory. 2. Then download poi-library files and save in the current library. 3. Now you can use xlwrite without any problem.........

7 comentarios

Geoff Hayes
Geoff Hayes el 7 de Ag. de 2014
azizullah - what is the poi-library?
Image Analyst
Image Analyst el 7 de Ag. de 2014
And xlwrite - what is that? A File Exchange submission?
azizullah khan
azizullah khan el 8 de Ag. de 2014
Editada: azizullah khan el 8 de Ag. de 2014
Hoeff Hayes:
poi-3.8-20120326.jar
poi-ooxml-3.8-20120326.jar
poi-ooxml-schemas-3.8-20120326.jar
xmlbeans-2.3.0.jar
dom4j-1.6.1.jar
Download these files and save it in folder name poi_library in your current directory....
azizullah khan
azizullah khan el 8 de Ag. de 2014
Image Analyst: xlwrite is an alternative for xlswrite and is mainly used both for MAC/win where the activation makes problem...
Image Analyst
Image Analyst el 8 de Ag. de 2014
It's not in my MATLAB (I have the win version). Where does a person obtain the xlwrite() function?
Geoff Hayes
Geoff Hayes el 8 de Ag. de 2014
I have the Mac version which does not include xlwrite (only xlswrite).
Image Analyst
Image Analyst el 8 de Ag. de 2014
Not sure why azizullah didn't think to provide the link. I did a search of the File Exchange and found two with that name: http://www.mathworks.com/matlabcentral/fileexchange/index?utf8=%E2%9C%93&term=xlwrite

Iniciar sesión para comentar.

Preguntada:

el 7 de Ag. de 2014

Comentada:

el 11 de Ag. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by