我只想问我如何获得名称和路径的实际打开Woorkbook与VBA?获取使用VBA打开的Woorkbook的名称和路径
我想它在下面的代码段拍摄的,但总是收到编译错误。
我的文档类型为.docm
。
我在做什么错?
我的代码片段:
Sub TestFileOpened()
Dim strPath As String, strPathAndName As String
strPath = Application.ThisWorkbook.Path
strPathAndName = strPath & Application.ThisWorkbook.Name
MsgBox strPathAndName
' Test to see if the file is open.
If IsFileOpen(strPathAndName) Then ....
'ThisWorkBook'是Excel对象!你在Word中工作吗? – user3598756
谢谢你,那是我的错! –