+ Reply to Thread
Results 1 to 12 of 12

Open workbook from file location

  1. #1
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Open workbook from file location

    Hello,

    I am trying to come up with a way to open a file from a specific directory upon clicking a button. The workbooks that I am wanting to open will always be in the same folder, but new versions are updated daily so I want the user to be able to select the specific workbook they are wanting to open. For example, if the user wanted to open "systems check" from the Documents folder the code below works, but If they wanted to open a different file in that location I want the file explorer to open to that file location. Then the user would select the file they wanted.

    Please Login or Register  to view this content.
    Thank you!

  2. #2
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Open workbook from file location

    Hi Erice,

    try this code, i have build something similar in the past. where it will open up dialog box, user to select a file and open.
    Please Login or Register  to view this content.
    Thanks
    Lex

  3. #3
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Open workbook from file location

    Lex,

    Thank you for that. It is working like I was hoping it would. Since we like to bury our files in complex file paths this will save a lot of time!

  4. #4
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Open workbook from file location

    Thank you erice for this important topic
    And Thank you Lex for this amazing code but I have a question here ... That how can I solve the debug when I press Cancel " I mean after the pop windows appear to select the needed file"

    Thanks In advance.

  5. #5
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Open workbook from file location

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Open workbook from file location

    Thanks but after added the mentioned line still got the debug Capture18.PNG

  7. #7
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Open workbook from file location

    Hi, below is the code I usually use, may run better

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Open workbook from file location

    Many Thanks Poizhan it's working great and please still need another thing that if there's any possibitlly to copy range of data from another closed workbook " without opening it "to another active workbook whatever the cells format, As I have code (GetData) but when I run it it's not get all data because of formatting .

    Thanks in advance

  9. #9
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Open workbook from file location

    @Mohamed, You're welcome, I recommend opening another thread so we don't muddy the waters. Make sure to describe your issue in detail and provide a sample workbook.

  10. #10
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Open workbook from file location

    Many Thanks Poizhan I'll do it dear

  11. #11
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,398
    Quote Originally Posted by Mohamed Hassan View Post
    Many Thanks Poizhan it's working great and please still need another thing that if there's any possibitlly to copy range of data from another closed workbook " without opening it "to another active workbook whatever the cells format, As I have code (GetData) but when I run it it's not get all data because of formatting .

    Thanks in advance
    Maybe like this
    Please Login or Register  to view this content.
    Last edited by daboho; 10-10-2018 at 01:54 PM.

  12. #12
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Open workbook from file location

    This was working for me, until I tried to move it over to look for files on a shared network drive. You can see that the folder I am trying to reference is located in \\corp.worthing.local.\Secure\WTN\Cost_Est\COST ESTIMATING\2018EST. Is there something else I need to do if I want to use this on a shared network drive?

    Please Login or Register  to view this content.
    Last edited by erice; 10-10-2018 at 04:36 PM.

+ 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. Open File Location / Select File - But don't open
    By MrGezus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 09:13 AM
  2. [SOLVED] Specify export pdf file location is location workbook is saved.
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2014, 01:13 PM
  3. [SOLVED] Open file from location using VBA code - file name changes everytime.
    By Swapnil.Kupwade in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2013, 11:48 AM
  4. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  5. Replies: 2
    Last Post: 01-19-2013, 09:13 AM
  6. Replies: 5
    Last Post: 09-29-2012, 12:40 PM
  7. help to open any .text file from any location
    By vivek_vermaiet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2011, 09:31 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