思路
循环Workbooks集合,并利用Workbook对象的Name属性,FullName属性和Path属性,获取所有打开的工作簿的名称和路径。
代码实现'==================================================================================================================
'
' 获取打开的工作簿路径和名称
'
Sub 获取打开的工作簿路径和名称()
Dim wb As Workbook
'
For i = 1 To Workbooks.Count
Set wb = Workbooks(i)
MsgBoxEx "工作簿: " & i & vbCrLf _
& "名称: " & wb.FullName & vbCrLf _
& "保存位置:" & wb.Path
Next
Set wb = Nothing
End Sub