VB如何在EXCEL中添加、重命名工作表呢?
VB如何在EXCEL中添加、重命名工作表呢?下面是删除工作表的,测试是成功的。
程序代码:
Set C = CreateObject("Excel.Application") Set D = C.Workbooks.Open("C:\Users\Admin\Desktop\test.xlsx") D.Worksheets("sheet1").Delete D.Close True Set C = Nothing
Set C = CreateObject("Excel.Application") Set D = C.Workbooks.Open("C:\Users\Admin\Desktop\test.xlsx") D.Worksheets("sheet1").Delete D.Close True Set C = Nothing
Set D = C.Workbooks.Open("d:\test.xlsx") Set sh = D.Worksheets.Add sh.Name = "newsheet" D.Close True Set C = Nothing