+ Reply to Thread
Results 1 to 5 of 5

VBA Code: Activate Workbook Using Cell Value

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    VBA Code: Activate Workbook Using Cell Value

    Hello,

    i have the file name stored in C2 and the file is already open. what would be the code to activate this file? i tried activating this by storing the cell value in a variable..but it does not work and gives me error message "Subscript out of range"

    Please Login or Register  to view this content.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: VBA Code: Activate Workbook Using Cell Value

    try this:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: VBA Code: Activate Workbook Using Cell Value

    Hi DGagnon,

    Thanks for your reponse.

    My apologies. It is typo. even with workbooks(desfile).activate it is still giving the same error message

  4. #4
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: VBA Code: Activate Workbook Using Cell Value

    Hey..

    Thanks it is working. I had given the full path name instead of just file name and i believe that is the cause.

    Thanks for your support.

  5. #5
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: VBA Code: Activate Workbook Using Cell Value

    no proplem, glad it is working, could you please mark thread as solved?

+ 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