Just looking at your code and I don't see anything that should be giving you a
confirmation message. If you were using .SaveAs, then I'd understand...
But I'd use something like:
Option Explicit
Public Sub Test_Menu_Item_Run()
Dim WkbkName As String
Dim wkbk As Workbook
WkbkName = "D:\documents\file1.xls"
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)
On Error GoTo 0
If wkbk Is Nothing Then
MsgBox WkbkName & vbLf & "Could not be opened"
Exit Sub
End If
With wkbk
.RefreshAll
.Close savechanges:=True
End With
'get ready for the next time
WkbkName = "d:\documents\file2.xls"
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)
On Error GoTo 0
If wkbk Is Nothing Then
MsgBox WkbkName & vbLf & "Could not be opened"
Exit Sub
End If
With wkbk
'if this UpdatingAll procedure is in the same workbook
'as this test_menu_item_run macro, then just use Call
Call UpdatingAll
'otherwise use
Application.Run "'Warrants Sorted Lists.xls'!UpdatingALL"
.Close savechanges:=True
End With
End Sub
And if you still get a warning message, try changing this line (both spots)
from:
.Close savechanges:=True
To:
application.displayalerts = false
.Close savechanges:=True
application.displayalerts = true
End Sub
ps. If those filenames can change and you want the user to select them, you can
use application.getopenfilename:
Option Explicit
Public Sub Test_Menu_Item_Run()
Dim WkbkName As Variant
Dim wkbk As Workbook
WkbkName = Application.GetOpenFilename(filefilter:="Excel Files, *.xls")
If WkbkName = False Then
'user hit cancel
Exit Sub
End If
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)
On Error GoTo 0
If wkbk Is Nothing Then
MsgBox WkbkName & vbLf & "Could not be opened"
Exit Sub
End If
With wkbk
.RefreshAll
Application.DisplayAlerts = False
.Close savechanges:=True
Application.DisplayAlerts = True
End With
'get ready for the next time
WkbkName = Application.GetOpenFilename(filefilter:="Excel Files, *.xls")
If WkbkName = False Then
'user hit cancel
Exit Sub
End If
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)
On Error GoTo 0
If wkbk Is Nothing Then
MsgBox WkbkName & vbLf & "Could not be opened"
Exit Sub
End If
With wkbk
'if this UpdatingAll procedure is in the same workbook
'as this test_menu_item_run macro, then just use Call
Call UpdatingAll
'otherwise use
Application.Run "'Warrants Sorted Lists.xls'!UpdatingALL"
Application.DisplayAlerts = False
.Close savechanges:=True
Application.DisplayAlerts = True
End With
End Sub