I am trying to write a vba script to automatically open an excel file increase the day by one in a certain cell and then wait 2 minutes for all other field to populate information from the current day. Once the other field are populated I want the script to close the file and save as the day it ran the script. I am going to add this script to windows task manager to run daily at 2 am. so far I have something like this.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("c:\Users\dr\Desktop\test.xlsx")
objExcel.Application.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(3, 2).Value = "=today()"
WScript.Sleep 120000
wb.SaveAs Format( Now(), “DD-MMM-YY”)