我想把一个excel的工作表复制到另个一个工作薄,怎么出来的是个空白。
Dim Xls As Excel.Application = New Excel.Application '定义excel应用程序Dim Xlsbook, Save_xlsbook As Excel.Workbook '定义工作簿
Dim Xlssheet As New Excel.Worksheet '定义工作表
Save_xlsbook = Xls.Application.Workbooks.Add
Xls.DisplayAlerts = False
Xls.ScreenUpdating = False
Dim Sdlg As SaveFileDialog = New SaveFileDialog '定义一个保存对话框
Sdlg.FileName = "*.xls" '保存对话框的默认文件名
Sdlg.Filter = "EXCEL档案(*.Xls)|*.Xls" '过滤器设置
If Sdlg.ShowDialog = Windows.Forms.DialogResult.OK Then '如果保存对话框的确认按钮被按下
Save_xlsbook.SaveAs(Sdlg.FileName)
Xlsbook = Xls.Application.Workbooks.Open("d:\aaa.xls")
Xlssheet = Xlsbook.Sheets(1)
Xlssheet.Name = "部门值班"
Save_xlsbook.Sheets.Copy(After:=Xlssheet)
Save_xlsbook.SaveAs(Sdlg.FileName)
End If
--------------------编程问答-------------------- Xlssheet.Copy((Worksheet)Save_xlsbook.Sheets[Save_xlsbook.Sheets.Count], System.Reflection.Missing.Value);
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
补充:.NET技术 , C#