最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Opening an embedded word doc in Excel VBA - Stack Overflow

programmeradmin4浏览0评论

I want to be able to open an embedded word doc without using "ActiveDocument" as seen here:

    Set wordObject = Worksheets(1).OLEObjects("TemplateDoc")
    wordObject.Verb (xlVerbOpen)
    Set wordDocTemp = ActiveDocument

This opens the word doc, then sets the wordDocTemp to that word doc, as its now active. I am unable to use wordObject as a word doc.

I've tried:

Set wordObject = Worksheets(1).OLEObjects("TemplateDoc").Verb (xlVerbOpen)

But this always returns run-time error 424 "Object Required"

Using "ActiveDocument" occasionally causes an error, which is why i need a workaround.

发布评论

评论列表(0)

  1. 暂无评论