+ Post New Thread
Results 1 to 2 of 2
Coding Thread, Excel VB - Closing other workbooks in Coding and Web Development; Ive created a custom report template in SIMS that after generating my report copies the data into another spreadsheet. The ...
  1. #1

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,675
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    45

    Excel VB - Closing other workbooks

    Ive created a custom report template in SIMS that after generating my report copies the data into another spreadsheet. The problem is that after running (which it does fine) I am left with two extra copies of excel open in the background that I don't really need.

    Is there a way in VBA to close down other copies of excel? I've seen the code to colse the activeworkbook but that's the one I need open. It's the other's I need to close.

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,705
    Thank Post
    3,239
    Thanked 1,045 Times in 967 Posts
    Rep Power
    363
    Could try something like so

    Close the Internet Explorer Window - VBA Visual Basic for Applications (Microsoft) FAQ - Tek-Tips

    You can use similar code as I have seen it , to search through the window titles and if it matches a specific title then to close said application / exe

    http://vbadud.blogspot.com/2009/04/h...using-vba.html

    Will dig around later to see if I can find an example of finding a specific window by its title and then killing said process - this example seems to be similar

    http://www.andreavb.com/tip020021.html
    Last edited by mac_shinobi; 9th December 2010 at 05:05 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Assigning a excel Macro to work in all workbooks
    By FatBoy in forum Office Software
    Replies: 8
    Last Post: 24th November 2010, 02:23 PM
  2. EXCEL - Recording survey details in excel - Easiest way
    By reecec in forum Office Software
    Replies: 2
    Last Post: 28th April 2010, 08:16 PM
  3. Replies: 1
    Last Post: 22nd December 2009, 05:05 PM
  4. application closing
    By Robertf in forum Windows
    Replies: 3
    Last Post: 14th February 2009, 12:45 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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