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

Thread: code to return to active workbook

  1. #1
    Guest

    Default

    I am using code to open another workbook from an open workbook.
    In the workbook "SheetChange"module I have:
    Workbooks.Open Filename:="P:trial5.xls"
    works fine...

    After I update the ("Trial5") workbook, and close it, I get an EXE crash. I think I need to write the code to return and activate the original workbook ("PSFDB2"), but I dont know the code.

    Workbook.activate filename:="P:PSFDB.xls"....won't work

    Thanks
    Wrecker



  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-08 06:13, Anonymous wrote:
    I am using code to open another workbook from an open workbook.
    In the workbook "SheetChange"module I have:
    Workbooks.Open Filename:="P:trial5.xls"
    works fine...

    After I update the ("Trial5") workbook, and close it, I get an EXE crash. I think I need to write the code to return and activate the original workbook ("PSFDB2"), but I dont know the code.

    Workbook.activate filename:="P:PSFDB.xls"....won't work

    Thanks
    Wrecker


    Since your workbook is already open you don't need the path in your file name. This will work also:

    Workbooks("PSFDB.xls").Activate

    I'm curious if this will solve your problem. Please let me know if it does.

    Regards,
    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

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

    Default

    Thanks.it worked fine

    Wrecker

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
  •