xlswrite save as pop up with Excel 2007

  • Follow


I have a GUI which works on my computer and others that have Matlab 2008 and Excel 2003. On computers with Matlab 2008 and Excel 2007 though when I call the xlswrite function, I get a save as pop up that asks me to save a file as an xls. The file that it asks me to save does not have the same name as the file that I am writing to either as. It just asks me to save as a file with a name similar to 4345335...just a bunch of numbers.

I have dug a little deeper into this and found out that it seems xlswrite brings up the save as dialog box when executing line 239 in the xlswrite function (Excel.Workbook.Save) and the ExcelWorkbook variable is <1x1 Interface.Microsoft_Excel_12.0_Object_Library._Workbook> for the computers that use Excel 2007. For the computers that use Excel 2003 ExcelWorkbook is <1x 1 Interface.Microsoft_Excel>11.0_Object_Library._Workbook>. I think this might be one of the reasons why this is not working. The line of code where I call xlswrite is 

[SUCCESS,MESSAGE]=xlswrite(filename...
                ,data(1:(table_length(1)-1),1),'Data Table (INPUT)','D4'); 
where filename is a string variable with the name of the file and Data Table(INPUT) is the tba that I am writing to..just the standard xlswrite format.

I do call this line several times as I write multiple arrays to the same worksheet over and over again. This happens everytime and on the first attempt to execute the xlswrite function too.

Is there a way I can specify which Object library or with Excel version the function should use? I have also tried to use the xlswrite1 function but that does not work on my Matlab I get a message saying the function does not exists asking me if I want to create it. If you have any pointers as to how I can solve this please let me know. I am also need to the use of the COM port so a lot explanation will help.
0
Reply Cyril 3/26/2010 8:48:05 PM


0 Replies
450 Views

(page loaded in 0.016 seconds)

Similiar Articles:













7/24/2012 1:07:58 AM


Reply: