+ Reply to Thread
Results 1 to 4 of 4

VBA Set WordApp = CreateObject("Word.Application") run-time error

  1. #1
    Registered User
    Join Date
    07-06-2017
    Location
    UK
    MS-Off Ver
    Mac 2015
    Posts
    2

    VBA Set WordApp = CreateObject("Word.Application") run-time error

    Dear all,

    I am completely new to VBA programming but need a script to export data from an excel sheet automatically to a word template (on Mac!). I thought to start as simple as I can and wrote the script below. For some reason I managed to make the script work only once (i.e. the "Name", "Age", "Colour" and "Status" data from excel was copied onto the correct locations of the word template after which an error occurred). Since then, however, I keep getting a run-time error (Run-time error '-2146959355 (80080005)': Automation error) on the line "Set WordApp = CreateObject("Word.Application")". Anybody has any ideas on what could cause this error? Thanks in advance for taking a look!

    Joost

    ----------------

    Please Login or Register  to view this content.
    Last edited by Joost87; 07-07-2017 at 03:06 AM.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA Set WordApp = CreateObject("Word.Application") run-time error

    Please use code tags.

    Did you restart computer before trying this code a second time?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    07-06-2017
    Location
    UK
    MS-Off Ver
    Mac 2015
    Posts
    2

    Re: VBA Set WordApp = CreateObject("Word.Application") run-time error

    Hi Izandol

    Thanks for the reply. Restarted the computer, this time got the "Run-time error 7" on the same line. Again running the code gives the same results as described in my original message..

    Just to be clear (as I really don't know much about VBA): I wrote this code in a "module" in the visual basic editor.

  4. #4
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    721

    Re: VBA Set WordApp = CreateObject("Word.Application") run-time error

    Hello Joost,

    may be this setting works:
    go to "Tools>>Reference>Tick the Microsoft Word 14.0 Object Library" in VBA Editor.

+ 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. CreateObject("Excel.Application") doesnt work in Office 365
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2016, 08:00 AM
  2. Debug at Set oIE = CreateObject("InternetExplorer.Application")
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2013, 05:19 AM
  3. User Specific - CreateObject("Word.Application") Fails
    By Thanley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2013, 06:04 PM
  4. Replies: 2
    Last Post: 01-03-2013, 04:32 PM
  5. [SOLVED] Set OutApp = CreateObject("Outlook.Application") - Runtime error 429
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-29-2012, 09:44 AM
  6. CreateObject("Excel.Application")
    By Olivia Towery in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2006, 07:10 PM
  7. CreateObject("InternetExplorer.Application")
    By shart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2006, 01:14 PM
  8. ASP: CreateObject("Excel.Application") IIS 6.0 Win2003
    By Mau in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2005, 07:05 AM

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