Results 1 to 3 of 3

Thread: External Reference to closed workbook - stop cells from refreshing

  1. #1
    Neophyte samanthanyw's Avatar
    Join Date
    Dec 2019
    Posts
    4
    Articles
    0
    Excel Version
    2016

    External Reference to closed workbook - stop cells from refreshing



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Help!

    I put in a command into a workbook (Workbook A) where if you click the button, it will automatically open up another workbook (Workbook B) which in turn updates cells in Workbook A. I then save Workbook A and close Workbook A and close Workbook B.

    When I open up Workbook A again, I want those cells NOT to refresh unless I click the command button again to open up Workbook B.

    The problem is that they immediately return #REF and require me to click the button again.

    Help!

  2. #2
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    782
    Articles
    0
    Excel Version
    Excel 2010
    Care to post the code that runs when you click that button ?

  3. #3
    Neophyte samanthanyw's Avatar
    Join Date
    Dec 2019
    Posts
    4
    Articles
    0
    Excel Version
    2016
    Code:
    Sub Openworkbook_Click()
    'Updateby Extendoffice 20161008
        Dim xWb As Workbook
        Dim wbName As String
        On Error Resume Next
        Set xWb = Workbooks.Open("\\YEGFP1\Business_Svce\1 - GM FIR ROLL UPS\2020-21\Budget\FY21 National Initiatives.xlsx")
        wbName = xWb.Name
        If Err.Number <> 0 Then
            MsgBox "This workbook does not exist!", vbInformation, "Kutools for Excel"
            Err.Clear
        Else
            MsgBox "This workbook is opened!", vbInformation, "Kutools for Excel"
        End If
    End Sub

Posting Permissions

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