I am having trouble accessing internet data and copying it to my worksheet. My Code is:
ActiveWorkbook.RefreshAll
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 30
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Range("E12:E83").Select
Selection.Copy
Range("B12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C4").Select
Application.CutCopyMode = False
Selection.Copy
Range("C6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B75").Select
ActiveCell.Value = "=C74 * C75"
Range("B78").Select
The "RefreshAll" goes to the internet and pulls in the data okay. Howevwer, I can't stop the copy and paste until the refresh is done. I put in the "Wait Code" above. However, the RefreshAll command waits for 30 seconds before proceding even though it is inserted before the wait command. Any ideas would be appreciated!!
Thanks,
ActiveWorkbook.RefreshAll
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 30
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Range("E12:E83").Select
Selection.Copy
Range("B12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C4").Select
Application.CutCopyMode = False
Selection.Copy
Range("C6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B75").Select
ActiveCell.Value = "=C74 * C75"
Range("B78").Select
The "RefreshAll" goes to the internet and pulls in the data okay. Howevwer, I can't stop the copy and paste until the refresh is done. I put in the "Wait Code" above. However, the RefreshAll command waits for 30 seconds before proceding even though it is inserted before the wait command. Any ideas would be appreciated!!
Thanks,