+ Reply to Thread
Results 1 to 2 of 2

Switch focus back to open Excel workbook from Word

  1. #1
    Registered User
    Join Date
    03-12-2020
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    1

    Switch focus back to open Excel workbook from Word

    Hi - I'm using Excel 365.* I've opened a Word document via a macro and, after working in said document, I'm having trouble running the auto close macro to close (without saving) and returning the focus to my open Excel workbook.

    Please Login or Register  to view this content.
    I've tried different variations with no success. Can anyone help? Thanks.
    Last edited by jeffreybrown; 03-12-2020 at 09:38 AM. Reason: Please use code tags!

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

    Re: Switch focus back to open Excel workbook from Word

    Hi andrea_missio and welcome to ExcelForum.

    Try the following code which is included in the attached sample Workbook. The items in red, MUST be at the top of the Code Module.
    Please Login or Register  to view this content.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). https://www.excel-easy.com/vba/examp...-explicit.html

    Lewis

+ 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. Switch focus back to Excel from Outlook
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2015, 06:45 AM
  2. Switch to other (already open) Excel workbook?
    By pstein in forum Excel General
    Replies: 2
    Last Post: 03-30-2014, 01:16 PM
  3. [SOLVED] Minimize Excel and switch to open word document
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2013, 11:16 AM
  4. Cannot switch to an active excel workbook from word
    By kalt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2011, 11:44 AM
  5. How do I move focus from User Form back to Word Doc?
    By sauerj in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2010, 09:32 AM
  6. Getting excel to switch back to a workbook?
    By cuewoz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-25-2009, 05:51 AM
  7. Switch back to previous workbook
    By carterljohn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2007, 12:01 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