Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Alternative for ActivateNext or Previous Window

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hi everybody,

    In my workbook i have a macro which copies 'values' from 3 sheets to
    another workbook.

    To copy from and return i used ActiveWindow.ActivateNext or
    ActiveWindow.ActivatePrevious.

    This worked fine when the workbook was saved as .xls but not when it's saved as template (.xlt)

    I read something about a Count property you can use to determine how many visible and hidden workbooks are open.

    Can someone help me with an alternative way to 'switch' between 2 workbooks
    even if other workbooks are opened at that moment?


    Rudi

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try something like:
    Windows("Book1.xls").Activate

    Change the Window name to whatever you want.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-17 13:46, Al Chara wrote:
    Try something like:
    Windows("Book1.xls").Activate

    Change the Window name to whatever you want.
    This works when the workbook is saved to .xls

    when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened

  4. #4
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-17 13:46, Al Chara wrote:
    Try something like:
    Windows("Book1.xls").Activate

    Change the Window name to whatever you want.
    This works when the workbook is saved to .xls

    when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened

  5. #5
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can try using AppActivate (probably won't work):

    AppActivate "Microsoft Excel - Book1.xlt"


    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  6. #6
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-17 14:21, Al Chara wrote:
    You can try using AppActivate (probably won't work):

    AppActivate "Microsoft Excel - Book1.xlt"
    Tried - but sofar no luck! thanks anyway

    If the name of the active workbook, where the
    'values' are to be copied from, could be refreshed at the start of the macro one could refer to that and the other workbook.


Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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