+ Reply to Thread
Results 1 to 9 of 9

Select a file in a already open File Explorer window (previously Windows Explorer)

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Select a file in a already open File Explorer window (previously Windows Explorer)

    I have this code (thanks Ryan!) and it works just fine. I even modified the last row to not only open the window but also select the file, and it works!
    Now I'm gonna push my luck and ask to select the file if the window is already open. How to do that? And where do one find out about the .Windows object?

    Please Login or Register  to view this content.

    Links to where I found the code snippets:
    http://wellsr.com/vba/2016/excel/ope...-already-open/
    https://stackoverflow.com/questions/...ng-a-file?rq=1
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Bump!

    Perhaps delete the folder and then opening it again with the last row of code?

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Bump!
    How do I close an open folder?
    I can't make this work.
    https://stackoverflow.com/questions/...close-a-folder

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Hi,

    I am extremely curious as to why you need to do this? Why can't you simply start a new Explorer instance with the file selected? And indeed why do you need to select a file in Explorer at all?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Lazyness. I hate unnecessary clicks.
    I don't NEED to but it sure would be nice. The pdf generated by my Excel application ends up in a folder already full of pdf's, named in the same number system. If you remember the number of the PO you just worked with then fine. If you have a 1,5 second memory (like me) you appreciate some help picking it out.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    But why is it selected? What do you plan to do with it?

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Copy it to a mail.

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    It may be easier to just automate that as well?

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Select a file in a already open File Explorer window (previously Windows Explorer)

    Already done.
    However, half of the time people have already started to write their email before they think about what needs to go with it.
    Last edited by Jacc; 09-12-2017 at 05:45 AM.

+ 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. Macro - Open File Explorer, Select File, Import certain information from file
    By Drayde in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2015, 08:58 AM
  2. [SOLVED] How to toggle focus between INTERNET explorer window and WINDOWS explorer window using VBA
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 03:29 PM
  3. Command button(SEARCH) to open windows explorer to select file
    By sameerk0286 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-23-2010, 09:38 AM
  4. Replies: 1
    Last Post: 08-05-2006, 04:59 PM
  5. File info from Windows Explorer to Excel?
    By Wordgeek in forum Excel General
    Replies: 1
    Last Post: 09-15-2005, 10:05 AM
  6. Replies: 2
    Last Post: 06-28-2005, 12:05 PM
  7. Replace Excel File Open with Windows Explorer
    By KymY in forum Excel General
    Replies: 2
    Last Post: 05-02-2005, 09:06 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