📌  相关文章
📜  创建新工作表 Excel Visual Basic - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:57.212000             🧑  作者: Mango

代码示例1
Imports Excel = Microsoft.Office.Interop.Excel

Dim ExcelApp As New Excel.Application
Dim ExcelWorkBook As Excel.Workbook
Dim ExcelWorkSheet As Excel.Worksheet

ExcelApp.Workbooks.Open("ExcelFileName")
ExcelWorkBook = ExcelApp.ActiveWorkbook

PreviousSheetName = ExcelWorkBook.Sheets(ExcelWorkBook.Sheets.Count).Name

ExcelWorkBook.Sheets.Add(After:=ExcelWorkBook.Sheets(PreviousSheetName)).Name = "New Sheet Name"