+ Reply to Thread
Results 1 to 2 of 2

Opening Word Document with VBA - Run Time Error '438'

Hybrid View

MonTheEck Opening Word Document with... 01-21-2019, 11:53 AM
CK76 Re: Opening Word Document... 01-21-2019, 11:58 AM
  1. #1
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Angry Opening Word Document with VBA - Run Time Error '438'

    Hi there.

    I am trying to open a word document and insert text from Excel into the bookmarks. However, I am receiving the error '"Automation Error (438). Object doesn't support this property or method"' when the code below runs. Can you help?

    Code errors at
     .Open "http://collaborationcentre.sharepointname/Doc1.docx"

    Private Sub Generate_Click()
        Worksheets("Message Templates").Activate
        Range("F10") = TitleTextBox.Value
        Range("G10") = SurnameTextBox.Value
        Range("H10") = ComboBox1.Value
    
    Dim objWord As Object
    Set objWord = CreateObject("Word.Application")
        With objWord
            .Visible = True
            .Open "http://collaborationcentre.sharepointname/Doc1.docx"
            .Selection.Goto What:=wdGoToBookmark, Name:="Title"
            .Selection.TypeText Text:=Range("F10").Value
            .Selection.Goto What:=wdGoToBookmark, Name:="Surname"
            .Selection.TypeText Text:=Range("G10").Value
        End With
    End Sub

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Opening Word Document with VBA - Run Time Error '438'

    Should be...
    .Documents.Open "full file path"
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Opening and activating a word document
    By dflak in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2017, 12:16 PM
  2. [SOLVED] Opening Word document and powerpoint through vba
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2017, 05:52 AM
  3. opening word document from VBA
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2009, 04:02 PM
  4. Trouble opening Word document
    By Richard in forum Excel General
    Replies: 1
    Last Post: 08-02-2006, 09:40 AM
  5. [SOLVED] Opening a word document
    By RobH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2006, 07:41 AM
  6. [SOLVED] Opening a Word and/or PDF document from Excel
    By Vikesh Jain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2005, 08:00 AM
  7. Opening Word Document with excel
    By gandgsuarez@zipcon.net in forum Excel General
    Replies: 1
    Last Post: 03-20-2005, 10:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1