Problems with actxserver function for xlswrite?

3 views (last 30 days)
I have error: Undefined function 'actxserver' for input arguments of type 'char'. I use iMac (late 2009) and OSX 10.9.4. Matlab is 2014a (student) and I try write Excel-files using xlswrite. So, how I can write to Excel-files?

Answers (2)

Iain
Iain on 11 Aug 2014
I am guessing that since you're using an iMac, that you don't have windows installed, and that may explain why you do not have the option of using an activex server.
Do you have excel on that machine? If so, you might be able to use DDE methods (ddepoke, ddeinit, ddeexec) to send commands (and data) to an open excel application. You may need to understand VBA to do it though.
Another answer to your question is to use CSV files.
fopen, fwrite/fprintf and fclose will be what you need to use to do that, e.g.
fid = fopen('blah.csv','w');
fwrite(fid,uint8(['Hello, duckies, are you feeling well?' 10 13 '45, 23, 76, 235, 12345' 10 13]),'uint8');
fwrite(fid,uint8(['Goodbye, No I am dead., I told you i was sick.' 10 13 '454, 234, 476, 45, 1235']),'uint8');
fclose(fid);
  3 Comments
Kristian Vepsäläinen
Kristian Vepsäläinen on 11 Aug 2014
I use next function with writing to Excel:
function kirjoitus(polku, kirjoitettava)
if exist('G:\TUTKIMUS\Tulokset')
asema = 'G:\TUTKIMUS\Tulokset\';
elseif exist('E:\TUTKIMUS\Tulokset')
asema = 'E:\TUTKIMUS\Tulokset\';
elseif exist('/Volumes/KINGSTON/TUTKIMUS/Tulokset')
asema ='/Volumes/KINGSTON/TUTKIMUS/Tulokset';
elseif exist('/Users/aadmin/Documents/MATLAB/TUTKIMUS/')
asema ='/Users/aadmin/Documents/MATLAB/TUTKIMUS/';
else
asema='X:\Tutkimus\Tulokset\';
end
tayspolku=[asema polku];
[kork,lev]=size(kirjoitettava);
kirjoitettava=kirjoitettava(1:kork,1:lev);
xlswrite(tayspolku,kirjoitettava,'Sheet1','A2');
end
So, could you tell me, how this must change that I can write to CSV-file?
Image Analyst
Image Analyst on 11 Aug 2014
Use the 'dir' option in your call to exist().
Use csvwrite() or dlmwrite() instead of xlswrite().

Sign in to comment.


Ken Atwell
Ken Atwell on 14 Aug 2014
XLSWRITE is only fully support on Windows; on a Mac, try WRITETABLE or CSVWRITE instead.

Products

Community Treasure Hunt

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

Start Hunting!