Hi,
I have an excel file with 10 sheets and data in each sheet will increase as it gets updated. The number of columns remains the same(which is 10). The number of rows increases because it is dependent on the number of participants. I need to extract the values from every row of each sheet and write in a separate sheet so that the analysis gets easier.
I have done it using the conventional xlsread() and xlswrite command but it takes longer time when the number of rows increases. I tried using actxserver() and have following problems/queries:
clc
clear
filename = 'C:\Users\Tanmay Nath\Desktop\emotion.xls';
emotion = actxserver('Excel.Application');
emotion.Visible=0;
Workbook_emotion = emotion.Workbooks.Open(filename);
eSheets = emotion.ActiveWorkbook.Sheets;
eSheet1 = eSheets.Item(1);
eSheet1.Activate;
Range=eSheet1.Range('A1:J1');
Data=Range.Value
xlswrite1('C:\Users\Tanmay Nath\Desktop\test.xlsx',Data,'Sheet1','A1:J1')
emotion.Save();
emotion.Quit();
i checked this link to http://www.mathworks.com/matlabcentral/answers/18306-how-to-import-data-to-excel-through-matlab to use the xlswrite1 function, but it gives me error
??? Error using ==> evalin Undefined function or variable 'Excel'.
Error in ==> xlswrite1 at 2
Excel=evalin('base','Excel');
So can anyone please help me so that i can read my excel sheets one by one and extract the rows from every sheet and write in another sheet using actxserver.
Also, since the number of rows increases, so i need any update kind of function,so that when i run the code, it need not have to process the entire sheet again and it processes only the new entry.
Please help
Thanks
No products are associated with this question.
Here are a few links to help you:
http://msdn.microsoft.com/en-us/library/bb259457%28v=office.12%29.aspx
http://msdn.microsoft.com/en-us/library/bb242656%28office.12%29.aspx
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.range_methods.aspx
0 Comments