joelly
09-23-2012, 10:48 PM
Hello , i have the below which is working well for me, however i would like to improve it.
How can i make it so when cell B2 on the sheet is blank to end the script, but continue if there is data.?
Any help would be appreciated.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\letters\6 month reminders.xls")
objExcel.Application.Visible = False
objWorkbook.Sheets("Sheet1").QueryTables(1).Refresh
Wscript.Sleep 7000
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close
How can i make it so when cell B2 on the sheet is blank to end the script, but continue if there is data.?
Any help would be appreciated.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\letters\6 month reminders.xls")
objExcel.Application.Visible = False
objWorkbook.Sheets("Sheet1").QueryTables(1).Refresh
Wscript.Sleep 7000
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close