+ Reply to Thread
Results 1 to 3 of 3

Opening Excel within Word

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007/10
    Posts
    43

    Opening Excel within Word

    Hi all,

    I am trying to open Excel within a word macro that I am creating, but have been unsuccessful so far.

    Here is the current code that I have in the Word VBA window:

    Please Login or Register  to view this content.
    When running, I get the message "Class does not support automation or does not support expected interface."

    Also, I enabled "Microsoft Excel 14.0 object library" in the references...I am using office 2010.

    Any suggestions?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Opening Excel within Word

    Hi chicagoland8,

    The following is not tested since I don't like to use Early Binding (just a personal preference):
    Changes in red:
    Please Login or Register  to view this content.

    1. Having said that I don't see how your program can work, since you are calling a .xlsx file which by definition does not have any macros in it.
    2. Unless you have more than one 'ShowMsg()' macro, the 'Module1.' is not needed.


    Here is the code I tested on my machine that worked using Late Binding:
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Opening Excel within Word

    Obviously, an XLSX file does not have a macro that you can Run. Maybe you meant to open an XLSM file?

    Your syntax is off for the Run method as well. See if you can figure out from this Excel example.
    Please Login or Register  to view this content.

+ 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. Opening Word document with Excel
    By Mr.Jones in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-11-2007, 10:13 AM
  2. Opening Word in Excel
    By Jeralc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2006, 09:35 AM
  3. [SOLVED] opening an excel document in word
    By zoot in forum Excel General
    Replies: 4
    Last Post: 07-21-2005, 08:05 AM
  4. Opening Word from Excel
    By David in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2005, 11:05 AM
  5. [SOLVED] Opening Word Document with excel
    By [email protected] 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