Hi All,
I have a macro and half way through it executes a Microsoft Query report and then copies the output of that report to another workbook.
Problem is that before the query has had chance to load (only takes 2 seconds) the copying of the sheet has already been actioned and I am left with a blank sheet.
I have tried pausing the code using this
Sub Pause(PauseTimeInSeconds)
' Pause for x seconds
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + PauseTimeInSeconds
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
End Sub
but unfortunately is also pauses the query.
Can anyone advise pls
Thanks
John
Bookmarks