Rank: 862 based on 162 downloads (last 30 days) and 1 file submitted
photo

Alec de Zegher

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Alec de Zegher
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Feb 2013 Screenshot xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher xlswrite, excel, xlwrite, java, jexcelapi, mac 162 77
  • 4.81818
4.8 | 38 ratings
Comments and Ratings by Alec de Zegher View all
Updated File Comments Rating
05 Oct 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher

@Nikos
If you want to place the POI files somewhere else, it is possible, as long as you change the paths correctly in the "javaaddpath" commands.

04 Aug 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher

@Azizullah Khan
These should be in the zip file. Just extract the whole zip folder to your matlab workspace to make the demo work.
Alec

18 Jun 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher

@Gaurav:

It seems like a bug in Matlab itself.
Best would to file a bug submission at the Mathworks.

If it is urgent, you can edit the xlsread.m file directly to remove the bug. I don't have 2014a, so I cannot correct it myself.

Alec

05 Jun 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher

@Shaun:
It seems the "poi_library" folder is not in the same folder as your Text.xlWrite.m file....

05 Jun 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher

@Volker Schardt
Sorry for the late reply. I will be more than happy to add your code to the zip file. Can you please contact me by Private Message?

Thanks!
Alec

Comments and Ratings on Alec de Zegher's Files View all
Updated File Comment by Comments Rating
03 Dec 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher J

Nearly perfect - I would suggest a autoloading of the needed libraries like this:

% Check if POI lib is loaded - try to autoload
if exist('org.apache.poi.ss.usermodel.WorkbookFactory', 'class') ~= 8 ...
|| exist('org.apache.poi.hssf.usermodel.HSSFWorkbook', 'class') ~= 8 ...
|| exist('org.apache.poi.xssf.usermodel.XSSFWorkbook', 'class') ~= 8
try
cpath=fileparts(which(mfilename));
javaaddpath([cpath filesep 'poi_library' filesep 'poi-3.8-20120326.jar']);
javaaddpath([cpath filesep 'poi_library' filesep 'poi-ooxml-3.8-20120326.jar']);
javaaddpath([cpath filesep 'poi_library' filesep 'poi-ooxml-schemas-3.8-20120326.jar']);
javaaddpath([cpath filesep 'poi_library' filesep 'xmlbeans-2.3.0.jar']);
javaaddpath([cpath filesep 'poi_library' filesep 'dom4j-1.6.1.jar']);
catch
error('xlWrite:poiLibsNotLoaded',...
'The POI library is not loaded in Matlab.\nAutoloading failed ...\nCheck that POI jar files are in Matlab Java path!');
end

end

That maintains a high flexibility and increases the flawless usability also for matlab beginners ...

kind regards,
J

24 Nov 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher Metcalfe Lab

Hi Alex,

I'm having the same error some others were having, namely: "The POI library is not loaded in Matlab.
Check that POI jar files are in Matlab Java path!"

I've already added the whole xlwrite folder (with the poi_library folder) into the working directory, and also added a copy into the dynamic java path of MATLAB:

e.g. javaclasspath shows
DYNAMIC JAVA PATH
/Applications/MATLAB_R2013a.app/java/jar/poi_library

Any suggestions?

Thanks!

06 Nov 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher Ben Petschel

Ok the problem seems to be two of the tokens appear in reverse order to what getSheetNames was expecting. A fix that worked for me was to insert the following code before line 21 of toolbox/matlab/iofun/private/getSheetNames.m:

if isempty(match)
match = regexp(workbook_xml, ...
['<sheet name=".*(?<=<sheet name=")(?<sheetName>.+?)(?=" r:id="rId' num2str(sheetIDs(i)) '" sheetId=".*"/>)'], ...
'names' );
end

14 Oct 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher Martin

Hi Alec
Thanks for solving most of my problem, I'm just left with one issue. How do I either delete the content of a Cell or overwrite it with Not a number =NA().
Currently trying =NA() I get a string instead of having excel evaluating it to "#N/A" which is not plotted rather than the string being plotted as 0.
Thanks Martin

05 Oct 2014 xlwrite: Generate XLS(X) files without Excel on Mac/Linux/Win Generates ‘.xls’ & '.xlsx' files on Mac/Linux/Win without Excel, using same syntax as xlswrite. Author: Alec de Zegher Alec de Zegher

@Nikos
If you want to place the POI files somewhere else, it is possible, as long as you change the paths correctly in the "javaaddpath" commands.

Contact us