+ Reply to Thread
Results 1 to 5 of 5

Excel Macro: How to open a file with selected path?

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Excel Macro: How to open a file with selected path?

    Hi all!

    Let's say I would like to open a file xyz.exe from D:/aaa/bbb/ folder.

    I set the path with "Set the path" button. With "Open file" button i would like to open the xyz.exe file from the selected folder. How can I read the path from the textbox and use it to open the file?
    Can you pls help me with the code?
    I attached the excel sheet.

    Thanx
    Alfa
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Excel Macro: How to open a file with selected path?

    Try this

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: Excel Macro: How to open a file with selected path?

    Are you intending to open a file in Excel? Or are you intending the run an EXE from Excel?

  4. #4
    Registered User
    Join Date
    04-02-2012
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel Macro: How to open a file with selected path?

    Thnx for the help.
    Kelshaer: is there a way to use the first button just to set the path and the second button to run the specific file from the previously selected path?

    Dennis7849: I would like to run the EXE from excel using the button2

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel Macro: How to open a file with selected path?

    Problem solved :D

    Just aded some codes to CommandButton2:
    Please Login or Register  to view this content.
    Thnx
    Last edited by Leith Ross; 04-02-2012 at 02:44 PM. Reason: Added Code tags

+ 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