+ Reply to Thread
Results 1 to 3 of 3

Variable Workbook Name

  1. #1
    Registered User
    Join Date
    03-23-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    3

    Variable Workbook Name

    I'm fairly new to the Macro stuff so forgive me if this is an elementary problem. I couldn't seem to find any solutions with a search.

    Background:

    I have a workbook with a macro that is pulling information from a different closed workbook.

    I am trying to open this workbook whose name changes occasionally. Inside the workbook with the macro, I have the user make sure a cell has the correct workbook name that they are trying to consolidate information from. I then use this cell as the variable.

    Book = DiagramWs.Range(BW2).Value

    Workbooks.Open ("M:\Test\Test DB\ & Book & .xls")

    I get the error Method 'range of worksheet failed' highlighted on the Workbooks.Open code line.

    Thanks for any help or suggestions!

    Laura

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Variable Workbook Name

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-23-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Variable Workbook Name

    Thanks I figured it was some type of syntax!

    Thanks,
    Laura

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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