xlswrite doesn't work when passing on Matlab 2013

1 view (last 30 days)
Hello everyone, I used xlswrite to create excel file as normally. I've used Matlab v2011, and the code works well until I made a try on Matlab 2013 with the same lines of code. This time, with v2013, excel files wasn't created, there was no errors, so I'm very confused because xlswrite is supposed to work on 2013 as weel as 2011, isn't it ?
%%--------------Ecriture des matrices dans un .xls------------------------
% % Ouverture de l'application Excel
Excel = actxserver('Excel.Application') ;
% % Ouverture du fichier Excel source
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell,'MAT ALL','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_R,'DECH kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_check,'Bilan 4 check','B4') ;
if S.Save_SIM_option == 2
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_RC,'MAT RC','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_P,'MAT P','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CR,'CR kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CL,'CL kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_recup,'recup kWhcell','B4') ;
end
Do you know what could be the problem please ? Thanks a lot

Answers (1)

Shameer Parmar
Shameer Parmar on 23 Jun 2016
Try removing all ' [~,~]' from xlswrite() coammnd.. and run the code..
  2 Comments
Tuan-Tu
Tuan-Tu on 23 Jun 2016
Edited: Stephen23 on 23 Jun 2016
I tried it but it doesn't work either.
Shameer Parmar
Shameer Parmar on 23 Jun 2016
ok.. in your provided path for excel file, dot (.) is there.. I guess that is the issue..
Try removing that dot (.) and check..
In this string.. in between 'cd' and backslash(\)..
[cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls']

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!