Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Macro to Open Another Excel File (2002 (SP-2))

    Hi:

    I have a Word document that needs to be merged with an Excel File. When the Excel file opens, I need that Excel file to open another Excel file. All three files are in the same directory; however, these three files will be sent to different offices and may either be located on a network or on a local hard drive.

    My question is this: I have code in my first Excel file that triggers the second Excel file to open but that code is now folder (location) specific and I need it to not be. My original code was as follows (which works great if the folder location were to be the same across all computers):

    Workbooks.Open Filename:="j:leanneINDEX-Master.xls"

    The following code was suggested, replacing the above, but I get an error saying that it is still looking for j:leanne...

    Workbooks.Open Filename:=ActiveWorkbook.Path + "INDEX-Master.xls"

    Any help is greatly appreciated.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Macro to Open Another Excel File (2002 (SP-2))

    I think it needs to be:
    Workbooks.Open Filename:=ActiveWorkbook.Path & "" & "INDEX-Master.xls"

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro to Open Another Excel File (2002 (SP-2))

    Steve:

    Works like a charm - thanks so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •