我正在尝试通过VBA从Excel打开Word文档。我得到
运行时错误2146959355(80080005)
我需要将数据从Excel复制到Word,但是系统无法打开Word文档。
我的代码的一部分:
Dim ws As Worksheet, msWord As Object
Set ws = ActiveSheet
Set msWord = CreateObject("Word.Application")
With msWord
.Visible = True
.Documents.Open ThisWorkbook.Path & "~/Desktop/! Rezervační smlouva - vzor.docx"
.Activate
代码:
Dim oWord作为对象
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Ret = Application.GetOpenFilename()
oWord.documents.Open (Ret)