Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Aug 2002
    Location
    Boise, Idaho, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    open new workbook after closing current workbook (VBA/Excel 2000)

    Is there a way to programmatically close the currently running workbook, then open another workbook and run the Auto_Open macro in it? It seems like one of the events ought to let me do this.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: open new workbook after closing current workbook (VBA/Excel 2000)

    If the code is NOT in the active workbook:

    Activeworkbook.Close SaveChanges:=False
    Workbooks.Open "c:datatest.xls"
    Activeworkbook.RunAutoMacros xlautoopen
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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