Hi
I've got some external data in cell M7 and need to copy the values to another cell. I've recorded a macro that refreshes the external data and then copies and pastes the values. When I run the macro it copies and pastes the old values while the external data is refreshing.
The code look like this:
Sub Macro2()
'
' Macro2 Macro
'
'
Application.CutCopyMode = False
ActiveWorkbook.Connections("Connection").Refresh
Range("M7:N7").Select
Selection.Copy
Range("D7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
Can anyone help me with this. I've tried adding Calculate before range select and I also tried application wait but it doesn't fix the problem.
I've got some external data in cell M7 and need to copy the values to another cell. I've recorded a macro that refreshes the external data and then copies and pastes the values. When I run the macro it copies and pastes the old values while the external data is refreshing.
The code look like this:
Sub Macro2()
'
' Macro2 Macro
'
'
Application.CutCopyMode = False
ActiveWorkbook.Connections("Connection").Refresh
Range("M7:N7").Select
Selection.Copy
Range("D7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
Can anyone help me with this. I've tried adding Calculate before range select and I also tried application wait but it doesn't fix the problem.