Sub cf() '拆分工作簿4
Dim i As Integer, wb As Worksheet
Excel.Application.ScreenUpdating = False '禁止屏幕刷新
For i = 1 To Sheets.Count
Set wb = Workbooks("工作簿4").Sheets(i)
wb.Copy '复制工作表
ActiveWorkbook.SaveAs Filename:="d:data\" & wb.Name '将当前工作簿以“ "的名字保存到d盘data目录下
ActiveWorkbook.Close '关闭打开的表
Next
Excel.Application.ScreenUpdating = True '解禁刷新
End Sub
说是下标越界,为什么?
Dim i As Integer, wb As Worksheet
Excel.Application.ScreenUpdating = False '禁止屏幕刷新
For i = 1 To Sheets.Count
Set wb = Workbooks("工作簿4").Sheets(i)
wb.Copy '复制工作表
ActiveWorkbook.SaveAs Filename:="d:data\" & wb.Name '将当前工作簿以“ "的名字保存到d盘data目录下
ActiveWorkbook.Close '关闭打开的表
Next
Excel.Application.ScreenUpdating = True '解禁刷新
End Sub
说是下标越界,为什么?