1. 程式人生 > >VBA 工作簿

VBA 工作簿

Sub gongzuobu()
Dim wb As Workbook

Set wb = Workbooks("工作簿1.xltm")   ' 開啟某個工作簿

Set wb = Workbooks(1)      '開啟第一個工作簿

Set wb = ActiveWorkbook    '開啟活動工作簿

Set wb = ThisWorkbook    '開啟程式碼所在工作簿

MsgBox wb.Name

Workbooks.Add  '新建工作簿

ActiveWorkbook.SaveAs "C:\Users\ssss\Desktop\haha.xlsx"   '儲存工作簿


End Sub