+ Reply to Thread
Results 1 to 3 of 3

Exiting Excel from an Outlook Macro

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    Northern Ireland
    MS-Off Ver
    2010
    Posts
    17

    Exiting Excel from an Outlook Macro

    Hi All,

    I'm new to this forum and also to VBA. I have managed to create macros to do whatever I need to do from recording or finding bits of code online, but now I'm stumped with what I think is a very easy problem to solve - if only I knew the write letters to type (isn't that always the case?)

    I have written a macro in outlook that asks users if they are going to use a particular instrument each day (it's an Auto Open macro so every day when a user opens outlook the question is asked). I have also made a tally in Excel that tallys their response (either yes or no).

    The macro works perfectly and the tally works fine too, but I can't figure out how to close the Excel application from within the macro. I have a line at the end that closes the file.

    Please Login or Register  to view this content.
    And this closes the file within Excel and leaves the Excel application open. But I would like the Excel application itself to close. The following...

    Please Login or Register  to view this content.
    closes Outlook, but I don't want Outlook to close. All I want is to close Excel. In other words, I don't want people being left with an open Excel application when they open their Outlook. When the macro runs I want everything to be as it was before the macro started.

    Can somebody please help?

    Many thanks in advance.

    Kind regards,

    Andre

    P.S. Here's the full code...

    Please Login or Register  to view this content.
    Last edited by Alves76; 07-18-2012 at 05:08 AM.

  2. #2
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Exiting Excel from an Outlook Macro

    Use this

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-20-2012
    Location
    Northern Ireland
    MS-Off Ver
    2010
    Posts
    17

    Re: Exiting Excel from an Outlook Macro

    Thank you SO much. That did it.

    I knew it was an easy solution.

    Andre

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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