Need Help with executing a function based on time.
I have an application were I need to save the data in a
spreadsheet two times a day at specifc times. I need to
save them off as differnt name+date+time. My problem is
that when I do a comparison on the time, it executes the
function (msg boxs indicator) but the it doesnt create
the file. If I execute this with a button on the screen,
it will work everytime.
My Goal : I have some live data (DDE values) that I need
to save off in a static file of sometype, maybe there is
another solution that I havent considered, any
suggestions are thankfully welcomed.
-----------------------------------------
Execution command in a cell.
=IF(D80=E80,autosave(),"NOT RUNNING")
-----------------------------------------
Converting time value to a number for
the comparsion
=TIMEVALUE(D81)
=TIMEVALUE(E81)
-----------------------------------------
Function autosave()
Dim strdate As String
strdate = Format(Date, "ddd, mm dd yyyy")
ActiveWorkbook.SaveCopyAs Filename:="C:\temp\Myreport " &
strdate & ".xls"
MsgBox "Report Has Run"
End Function
------------------------------------------
|