+ Reply to Thread
Results 1 to 4 of 4

Run-time error 429 accessing Excel spreadsheet from Word VBA macro

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    West Virginia
    MS-Off Ver
    Mac Office 2011
    Posts
    3

    Question Run-time error 429 accessing Excel spreadsheet from Word VBA macro

    I'm writing a macro that will merge content from various Word documents, but I want to be able to pull certain configuration info out of an Excel file. It seems that should be relatively easy, but when I try to open the Excel workbook from within the Word macro, I get a run-time error. Here's the relevant code:

    Please Login or Register  to view this content.
    This is the exact error message I see:
    Run-time error '429':
    ActiveX component can't create object
    [End] [Debug] [Help]
    I've tried this code with Excel both running and closed, and with the particular xlsx file both open and closed. I've also tried saving in several other (older) Excel formats. No dice. At one point, I started getting a different error, but then I restarted both Word and Excel and haven't reproduced that error since.

    Note that I'm currently using the downloadable demo of Mac Office 2011 (until my purchased copy arrives). I have to wonder if that's the problem. Alternatively, I wonder if I simply cannot access an Excel workbook from within a Word macro. Unfortunately, there doesn't yet appear to be much discussion online with regard to Mac Office VBA programming. Any help would be appreciated!

    ...

    Note that I have the following references in place:
    • Visual Basic for Applications
    • Microsoft Word 14.0 Object Library
    • Microsoft Forms 2.0 Object Library
    • Microsoft Office 14.0 Object Library
    • Microsoft Excel 14.0 Object Library

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,143

    Re: Run-time error 429 accessing Excel spreadsheet from Word VBA macro

    Check this out
    http://word.mvps.org/faqs/interdev/c...xlfromword.htm

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    West Virginia
    MS-Off Ver
    Mac Office 2011
    Posts
    3

    Re: Run-time error 429 accessing Excel spreadsheet from Word VBA macro

    Excellent! That was exactly what I needed... solved all my problems and only introduced one new one! When I run the following, it always detects as an error, such that ExcelWasNotRunning is set to True even when Excel was already open. Any idea why? Either way, I'm able to get my data out, but of course this results in Excel being closed at the end even if I already had it open (and want to keep it open).

    Please Login or Register  to view this content.
    Many thanks, by the way. Great response, and quick too!

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    West Virginia
    MS-Off Ver
    Mac Office 2011
    Posts
    3

    Re: Run-time error 429 accessing Excel spreadsheet from Word VBA macro

    Additional info... whether or not Excel is open, that GetObject() call is resulting in Err.Description of:
    ActiveX component can't create object

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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