+ Reply to Thread
Results 1 to 2 of 2

Turning Off Circular Refrences on open

  1. #1
    Bhupinder Rayat
    Guest

    Turning Off Circular Refrences on open

    Hi all,

    I have set the max number of Iterations to 1 in calcuation, so I do not get
    circular references for a particular workbook, and then turned iterations off
    again on close, using the following code...

    Private Sub Workbook_Open()

    With Application
    .Iteration = True
    .MaxIterations = 1
    .MaxChange = 0.001
    End With
    ActiveWorkbook.PrecisionAsDisplayed = False

    End Sub
    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    With Application
    .Iteration = False
    .MaxIterations = 100
    .MaxChange = 0.001
    End With
    ActiveWorkbook.PrecisionAsDisplayed = False

    End Sub

    The problem is that when I open this workbook again, Excel tells me that I
    have circuar references before running Workbook_open() which turns on
    iterations, as the current setting has iterations turned off, which I toggled
    when closing this workbook.

    How can I tell excel not to check for circular references BEFORE running the
    workbook_open() sub??

    Best regards,


    Bhupinder



  2. #2
    Tom Ogilvy
    Guest

    Re: Turning Off Circular Refrences on open

    While the settings are stored with the workbook, they are application level
    settings, so only the first workbook opened determines the application level
    setting. As you say, code does not run before this is checked. So there is
    no way you can do this within the subject workbook.

    --
    Regards,
    Tom Ogilvy


    "Bhupinder Rayat" <[email protected]> wrote in
    message news:[email protected]...
    > Hi all,
    >
    > I have set the max number of Iterations to 1 in calcuation, so I do not

    get
    > circular references for a particular workbook, and then turned iterations

    off
    > again on close, using the following code...
    >
    > Private Sub Workbook_Open()
    >
    > With Application
    > .Iteration = True
    > .MaxIterations = 1
    > .MaxChange = 0.001
    > End With
    > ActiveWorkbook.PrecisionAsDisplayed = False
    >
    > End Sub
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    >
    > With Application
    > .Iteration = False
    > .MaxIterations = 100
    > .MaxChange = 0.001
    > End With
    > ActiveWorkbook.PrecisionAsDisplayed = False
    >
    > End Sub
    >
    > The problem is that when I open this workbook again, Excel tells me that I
    > have circuar references before running Workbook_open() which turns on
    > iterations, as the current setting has iterations turned off, which I

    toggled
    > when closing this workbook.
    >
    > How can I tell excel not to check for circular references BEFORE running

    the
    > workbook_open() sub??
    >
    > Best regards,
    >
    >
    > Bhupinder
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1