Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Activate Excel from Word (Word 12)

    I want to open a file in Excel from my Word VBA macro. I have used GetObject/CreateObject as necessary to activate/launch Excel and open the file. I want to display in MsgBox in Excel instructing the user to SaveAs a new workbook.

    ObjExcel.MsgBox returns an error: the object doesn't support that. I could just as well display the message box in Word, but how then would I activate Excel? Activate is not a method. Mus I cycle through Tasks looking for Excel and the file I opened?

    Thanks,
    Richard Barrett

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Activate Excel from Word (Word 12)

    MsgBox is a general VBA function, it's not a method of the Word or Excel Application object.
    Make sure that you set the Visible property of ObjExcel to True. Use the following to activate Excel:

    AppActivate "Microsoft Excel"

    If you know the name of the workbook, you can use that:

    Appactivate "Microsoft Excel - MyWorkbook.xls"

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Activate Excel from Word (Word 12)

    Thanks very much. This worked well.
    Richard

Posting Permissions

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