Results 1 to 1 of 1

Macro for opening worbooks

Threaded View

  1. #1
    Registered User
    Join Date
    03-07-2010
    Location
    Ulsan, South Korea
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Macro for opening worbooks

    Hi,

    I use the below macro to open different worbooks in one folder.
    ***********************************************
    Private Sub CommandButton2_Click()
    Workbooks.Open Filename:="D:\Book2.xlsx"
    End Sub
    ***********************************************
    It works fine if I use it in the same computer but if I move the file with
    the workbooks to another computer or different disk drive, I have to
    modify every time the address of each macro.
    Could you give me a hint how to modify the address "D:\Book2.xlsx" in
    order the macro to look the folder and open the worbook in the folder,
    regardless in which disk drive or computer the folder is.

    posted also here: http://www.mrexcel.com/forum/showthread.php?t=639435

    Thank you in advance.

    Krasimir
    Last edited by lechev65; 06-02-2012 at 09:51 PM. Reason: Added code tags

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