Hi there, i am relatively new to macros.
I have this macro in place to copy the data from one work to another which runs fine. But everytime I run the macros I have a dialog box that opens up in the source sheet, which asks if I need to update the external links. I need to manually click Update, and then the continue option for the macro to run. how can we tune the macro to automatically select Update option when the dialog box opens up and then the continue option.
Sub Macro9()
Dim SrcWB As Workbook
Dim dstWB As Workbook
Dim SrcWS As Worksheet
Dim dstWS As Worksheet
Dim Lastrow As Long, i As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Set dstWB = ThisWorkbook
Set dstWS = dstWB.Worksheets("Sheet1")
Set SrcWB = Workbooks.Open("Z:\Weekly Tracker\Deepa\pairs final\final\final\US pairs\US BANK PAIRS.xlsm")
Set SrcWS = SrcWB.Worksheets("live Sheet")
SrcWS.Range("B5:O32").Copy
dstWS.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
SrcWB.Close SaveChanges:=False
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Thankyou in advance
I have this macro in place to copy the data from one work to another which runs fine. But everytime I run the macros I have a dialog box that opens up in the source sheet, which asks if I need to update the external links. I need to manually click Update, and then the continue option for the macro to run. how can we tune the macro to automatically select Update option when the dialog box opens up and then the continue option.
Sub Macro9()
Dim SrcWB As Workbook
Dim dstWB As Workbook
Dim SrcWS As Worksheet
Dim dstWS As Worksheet
Dim Lastrow As Long, i As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Set dstWB = ThisWorkbook
Set dstWS = dstWB.Worksheets("Sheet1")
Set SrcWB = Workbooks.Open("Z:\Weekly Tracker\Deepa\pairs final\final\final\US pairs\US BANK PAIRS.xlsm")
Set SrcWS = SrcWB.Worksheets("live Sheet")
SrcWS.Range("B5:O32").Copy
dstWS.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
SrcWB.Close SaveChanges:=False
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Thankyou in advance