Error exporting data to Excel

I'm currently receiving this error when trying to export data using xlswrite:
"Error using xlswrite (line 219)
No appropriate method, property, or field workbooks
for class COM.Excel_Application."
I've tried various workarounds, such as disabling Excel add-ins ( as suggested here ), however nothing seems to helped me to get this hump. Restarting the program doesn't help, and the column of data is too long to Copy.
The code I'm currently using is thus:
">> filename = 'trend.xls'
>> load('theil_spring.mat')
>>A=theil(:,1)
>>xlswrite(filename,A)"
I would greatly appreciate any help with this matter. Apologies if this is a basic issue - I'm new to MatLab and I'm still having some teething pains.

1 Commento

I created a work-around to solve this. It turns out the amount of data was causing memories in MatLab. To solve this I used the following code to re-organise my data:
j=1;n=length(theil);k=2;
for i=1:(n/k)
X(:,i)=theil(j:j+(k-1),1);
j=j+2;
end
It was then a simple matter of copy & pasting it into Excel. Crude, but it worked.

Accedi per commentare.

Risposte (1)

mun1013
mun1013 il 2 Lug 2015

0 voti

It should be filename = 'trend.xls'

3 Commenti

Thanks for the reply. I have included the .xls in my code but left it out of the question. Edited to reflect this. Apologies for the confusion.
mun1013
mun1013 il 2 Lug 2015
is there something you missed out in this function? xlswrite(filename, A , 'Sheet1' ,'A1:Z1');
I've checked the associated documentation, and I don't need to specify a page or range. It's a single data column of 1865346 cells, specified as a cell array, which I want to export. I did specify the range in the function ('A1:A1865346')in case it helped. Either way the error persists.

Accedi per commentare.

Richiesto:

il 2 Lug 2015

Commentato:

il 2 Lug 2015

Community Treasure Hunt

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

Start Hunting!

Translated by