External Reference to closed workbook - stop cells from refreshing

samanthanyw

New member
Joined
Dec 9, 2019
Messages
4
Reaction score
0
Points
0
Excel Version(s)
2016
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!
 
Care to post the code that runs when you click that button ?
 
Code:
Sub Openworkbook_Click()
'Updateby Extendoffice 20161008
    Dim xWb As Workbook
    Dim wbName As String
    On Error Resume Next
    Set xWb = Workbooks.Open("[URL="file://\\YEGFP1\Business_Svce\1"]\\YEGFP1\Business_Svce\1[/URL] - 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
 
Back
Top