我试图用Excel打开一个Word文档,使用VBA。下面是代码:不打开word文档
Sub Openuserguiddoc()
'Open an existing Word Document from Excel
Dim objWord As Object
Set objWord = CreateObject("User Guide to VR Referrals.docx")
objWord.Visible = True
Documents.Open "N:\MHBS\Education and Employment\VR Reports\VRU REFERALS\Past Years Referrals\User Guide to VR Referrals.docx"
End Sub
它Set objWord = CreateObject("User Guide to VR Referrals.docx")
挂断。 但是对于我的生活,我无法弄清楚什么是错的。有任何想法吗?
也许你需要提供完整的路径? –
不,他应该提供“Word.Application”作为参数给CreateObject – z32a7ul
@ z32a7ul nope,此方法也适用。 –