标签:turn serve aaa work 输出内容 对话 操作 sheet 数据
clc; clear; [Filename,Pathname,index]=uiputfile({‘*.xls‘;‘*.xlsx‘},‘另存为‘,‘test‘) if index==0 %判断对话框的操作结果 return; %如果点取消,则中断程序 end; file= [Pathname Filename]; try Excel = actxGetRunningServer(‘Excel.Application‘); catch Excel = actxserver(‘Excel.Application‘); end; %Excel.Visible = 1; if exist(file) delete(file); end Workbook = Excel.Workbooks.Add; Workbook.SaveAs(file); Sheets = Excel.ActiveWorkbook.Sheets; Sheets.Item(1).name=‘数据‘; Sheet1 = Sheets.Item(1); Sheet1.Activate; Sheet1.Range(‘A1‘).Value =‘aaa‘; Sheet1.Range(‘B1‘).Value=‘bbb‘; Workbook.Save; Excel.Quit; Excel.delete;
标签:turn serve aaa work 输出内容 对话 操作 sheet 数据
原文地址:https://www.cnblogs.com/yangzhuxi/p/9976091.html