matlab怎么创建一个新的excel工作表?网上找了好久,只知道matlab可以重命名和删除工作表:
sheets.item.name=***
sheets.item.delete
有大神知道怎么创建一个新的工作表吗?
注意了,是创建新的工作表,也就是sheets而不是给我创建新文件,切记切记
excuse me???what are you talking about???
追答Hi,I answer your question about how to create a file of EXCEL.If you want to add a sheet only in an excel file ,it is very simple.An excel file comprises many sheets ,at least three sheets already existing,you can use them casually,and you needn't add else one.
追问.........拜托请看清楚问题好吗,我是要创建新的excel的工作表,不是创建一个新的excel工作簿懂吗?could you please understand my meaning clearly? i'd like to create new excel sheets, not to create a new excel file, do you understand?
追答用xlswrite就可新建一个工作表,如:
>> [~,sheets,~] = xlsfinfo('病人信息.xlsx')
sheets =
'Sheet1' 'Sheet2' 'Sheet3'
>> d1=1:3;%d1数据可随意写
xlswrite('病人信息.xlsx',d1,'Temp1');
>> [~,sheets,~] = xlsfinfo('病人信息.xlsx')
sheets =
'Sheet1' 'Sheet2' 'Sheet3' 'Temp1'
就多了一个工作表'Temp1'
也许吧,不过我已经靠自己解决了并且实现了自动化,分给你
WorkSheets = Excel.ActiveWorkBook.WorkSheets;
Count = WorkSheets.Count;
WorkSheets.Add([],WorkSheets.Item(Count));