+ Reply to Thread
Results 1 to 4 of 4

Close Folder

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Close Folder

    Hi,
    I am trying to close an open folder using VBA.
    The folder is like: c:\My Jobs\Folder to Close
    What would be the code to close this?
    Thank you

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Close Folder

    There is no concept in Windows or VBA of an open folder, only open files. (There is the idea of Windows Explorer being open to a folder, but Excel and VBA won't care or even know about that.) How did this folder get open in the first place?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Close Folder

    This is how I opened it:

    Please Login or Register  to view this content.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Close Folder

    What you have done is a shell call to Windows to open a Windows Explorer window on a particular folder. I will have to step aside on this one as I have not done shell calls in VBA. I believe there is a way to call Shell to return a process ID and then later you can go back and close that process, but I am not familiar with how it works.

+ 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. [SOLVED] macro to open all files in a folder, save them, then close them
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2013, 06:40 PM
  2. Macros Open folder, copy, paste and close the folder
    By hahahahahahaha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 05:03 PM
  3. close all workbooks in other folder
    By dsrt16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2009, 11:46 AM
  4. Close a Folder
    By aftamath in forum Excel General
    Replies: 5
    Last Post: 10-13-2005, 10:05 AM
  5. I like to open a folder,auto print,save then close
    By tied of opening files in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2005, 06:06 PM

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