I'm very new to vb script. I've looked on the internet and haven't quite found what I need. I have a script that works for the most part, but it doesn't give excel time to refresh all the QueryTables (takes about 3min to refresh). So, I'm wondering if there is code to put in for delay before it saves the file? Or is there another way to do this?
Any help is most appreciated.thank you
Code:
sub main
dim objWorkbook
'======================================================
myPath = "C:\test"
'The Excel file to be converted
strInput = myPath& "VF_h.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = FALSE
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open(strInput)
Call objWorkbook.RefreshAll()
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
end sub
Any help is most appreciated.thank you