Prev: NDFT
Next: FFT Scale Factor
From: ade77 on 2 Mar 2010 11:11 "David " <shuai.hou(a)firstcoverage.com> wrote in message <hmj7kv$29v$1(a)fred.mathworks.com>... > Hi ade77, > > I tried your way, justing change the way I name the file. It works well for a long time but eventually a pop up showed up and ruined the process. I think this might be some issue about how my excel and matlab is installed. David, If you have excel 2007 installed, that might be causing the problem. One option is to silently open the file in activex, then save it and close it. I have added the activex code below. Note: this will add insignificant or no time to the overall program. filename = 'C:\Documents\MATLAB\scoreIdeas\scoreIdeas'; for i = 1:n ...... actual_file = strcat(filename,num2str(i)) xlswrite(actual_file ,rawTrades); Excel = actxserver('Excel.Application'); Workbooks = Excel.Workbooks; Excel.Visible = 0; Workbook = Workbooks.Open(actual_file); Workbook.Save; Excel.Quit; end
From: ImageAnalyst on 2 Mar 2010 14:10
I just want to add that what you said, "I checked xlswrite1() file, but I don't think it will help a lot in my case. I am writing a cell array to a xls file in each loop, and the file names are different among loops. So I have to creat, open, write and close once for every file." is not true. You can open Excel once and open a bunch of different workbooks using code like ade77 showed you, and finally Quit Excel. I know, I've done it. |