您的这句代码加在什么地方,我尝试
Private Sub Command83_Click()
Dim wks1 As Object
Set ex1 = CreateObject("excel.application")
Set exwbook1 = ex1.Workbooks.Open("D:\abc\123.xls")
xlBook.Worksheets(1)
ex1.Visible = True
End Sub
不行,您说的“xlBook.Worksheets(1) 修改 1为 2 3 4”
是不是第一个工作簿,第二个工作簿的意思?
Private Sub Command83_Click()
Dim wks1 As Object
Dim ex1
Dim exwbook1
Set ex1 = CreateObject("excel.application")
Set exwbook1 = ex1.Workbooks.Open("D:\abc\123.xls")
ex1.Visible = True
exwbook1.sheets(2).Activate '2代表要打开D:\abc\123.xls中的第二个工作表
End Sub