Open multiple workbooks with path in different cells

  • Hello Guys.



    I have a file with some paths. What I am trying to do, is create a macro that open two of those paths.
    I have following code, but for some reason, only open one workbook (the one that I have first, if I switch c9 to c12, its open c12...always the first one).


    Code
    a = ActiveSheet.Range("c9").Value
    Workbooks.Open a


    And

    Code
    b = ActiveSheet.Range("c12").Value
    Workbooks.Open b


    Help!


    Xavi

  • Re: Open multiple workbooks with path in different cells


    Xavi - please use code tags in future as per the forum rules.


    After you open the first workbook, the activesheet will refer to that workbook, not your original one, so you need to add a workbook reference to both lines.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!