Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    workbook close (Excel 2003)

    Hi all,

    I'm trying to open, and close a workbook on a server, I would like it NOT to ask if I would like to save changes, but it seems Excel seems to ask regardless, is there a way to bypass that feature?

    Thanks,
    Darryl.

    Private Sub Workbook_Open()
    On Error GoTo Err:

    Application.EnableEvents = False
    Application.ScreenUpdating = False

    Workbooks.Open Filename:="P:Press1ZONING SA-2-SA-3- TH-2SA3 Zoning weekly completion.xls"
    ActiveWindow.Close

    Err:
    Application.EnableEvents = True
    ActiveWorkbook.Saved = False
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: workbook close (Excel 2003)

    Replace

    ActiveWindow.Close

    with

    ActiveWorkbook.Close SaveChanges:=False

    (Seems pretty useless, though, to open a workbook and immediately close it again)

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: workbook close (Excel 2003)

    Thanks Hans.

    You're right, but it's the only way that I can update the values of the cells that I want linked. For whatever reason there is one merged cell that does not want to update with all the data in the cell.

    Thanks.

Posting Permissions

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