Error using xlswrite1

3 views (last 30 days)
Daniel Allkenmach
Daniel Allkenmach on 3 Feb 2016
When using xlswrite1, I havae been having some issues with it correctly writing data to the spread sheet; it doesnt upload at all. When uploading this:
%comment
Excel = actxserver ('Excel.Application');
File='C:\YourFileFolder\FileName';
if ~exist(File,'file')
ExcelWorkbook = Excel.workbooks.Add;
ExcelWorkbook.SaveAs(File,1);
ExcelWorkbook.Close(false);
end
invoke(Excel.Workbooks,'Open',File);
I get this: Error using Interface.Microsoft_Excel_11.0_Object_Library._Workbook/SaveAs.
I cannot use xlswrite due to the amount of things I have, but xlswrite1 isnt working. How can I fix xlswrite1 so it not only doesnt give me this error, but it allows for the data to be transferred to the excel document. This is adding onto my last question which can be viewed here: http://www.mathworks.com/matlabcentral/answers/266354-how-can-i-use-xlswrite-in-a-nested-forloop-without-overwriting
  2 Comments
Walter Roberson
Walter Roberson on 3 Feb 2016
Is an extension included in the file name? Is the destination writable?
Daniel Allkenmach
Daniel Allkenmach on 3 Feb 2016
I just did that. BUt now each time I try to open the excel file, it says it it locked. Why is that?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!