Hi
I have macro that open particular file please tell me how to close that file after particular time
I have macro that open particular file please tell me how to close that file after particular time
Code:
Dim TimeToRun
Sub auto_open()
Call ScheduleCopyPriceOver
End Sub
Sub ScheduleCopyPriceOver()
TimeToRun = Now + TimeValue("00:02:00")
Application.OnTime TimeToRun, "CopyPriceOver"
End Sub
Sub CopyPriceOver()
' Calculate
' Range("c7").Value = Range("d7").Value
Workbooks.Open "C:\Users\swami\Desktop\1M&N.xls"
Call ScheduleCopyPriceOver
End Sub
Sub auto_close()
On Error Resume Next
Application.OnTime TimeToRun, "CopyPriceOver", , False
End Sub