+ Reply to Thread
Results 1 to 8 of 8

Opening a workbook from another workbook using VBA

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Inola, Ok
    MS-Off Ver
    Excel 2007
    Posts
    6

    Opening a workbook from another workbook using VBA

    Is there a way to open an excel workbook via a button located in another workbook? I want to be able to open a workbook that has a list of standard notes that I can copy and paste in the workbook I am currently working on. I would like to just click a button and have the file open up. Any help would be greatly appreciated.

    JB

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Opening a workbook from another workbook using VBA

    Yes.. You Can easily do it.. Just give me the path and file name of the Workbook that needs to be opened..
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Opening a workbook from another workbook using VBA

    Sure this can be done. Input the below code into your VBE editor and attach it to a button. Change the path as per your system.

    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Opening a workbook from another workbook using VBA

    Please put the Code in a Module

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-24-2013
    Location
    Inola, Ok
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Opening a workbook from another workbook using VBA

    Quote Originally Posted by msexcelathome View Post
    Yes.. You Can easily do it.. Just give me the path and file name of the Workbook that needs to be opened..
    Works great!

    Thanks!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Opening a workbook from another workbook using VBA

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

  7. #7
    Registered User
    Join Date
    05-06-2013
    Location
    South Florida
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Opening a workbook from another workbook using VBA

    Instead of listing the file to open in a sub, is it possible to enter the filename in a userform? I'm asking because I have a template that will consistenly have a different file name when sent to me. I'd like to simply enter the file into a text field and click ok to open. After the workbook is open I have a sub written to copy the necessary data.

    Thanks,

    Connor

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Opening a workbook from another workbook using VBA

    Connor,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

+ 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