+ Reply to Thread
Results 1 to 3 of 3

Open another excel file in macro

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252

    Open another excel file in macro

    I'm trying to open another excel file to no avail. Here's what I have:
    Please Login or Register  to view this content.
    Any other ideas?

  2. #2
    Chip Pearson
    Guest

    Re: Open another excel file in macro

    Use the Open method of the Workbooks object.

    Workbooks.Open Filename:=your_file_name


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "DKY" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I'm trying to open another excel file to no avail. Here's what
    > I have:
    >
    > Code:
    > --------------------
    > Dim Location As String
    > Location = "U:\BridgeRun_" & VendorCode & "_" & Months &
    > "_Months.xls"
    > GetObject (Location)
    > --------------------
    >
    > Any other ideas?
    >
    >
    > --
    > DKY
    > ------------------------------------------------------------------------
    > DKY's Profile:
    > http://www.excelforum.com/member.php...o&userid=14515
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=543838
    >




  3. #3
    Ken Hudson
    Guest

    RE: Open another excel file in macro

    Hi,
    Looks to me like GetObject is not used for Excel files.
    I think you should be using:

    Workbooks.Open Filename:= Location

    to open an Excel workbook.

    --
    Ken Hudson


    "DKY" wrote:

    >
    > I'm trying to open another excel file to no avail. Here's what I have:
    >
    > Code:
    > --------------------
    > Dim Location As String
    > Location = "U:\BridgeRun_" & VendorCode & "_" & Months & "_Months.xls"
    > GetObject (Location)
    > --------------------
    >
    > Any other ideas?
    >
    >
    > --
    > DKY
    > ------------------------------------------------------------------------
    > DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
    > View this thread: http://www.excelforum.com/showthread...hreadid=543838
    >
    >


+ 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