Email Excel Workbook Automatically Daily

Joined
Jan 13, 2018
Messages
1
Reaction score
0
Hello,

I have an excel workbook file on a shared drive that multiple departments update daily. I need to figure out a way to have that file emailed to a list of people daily at a specified time.
I have tried a couple codes in MVB from other forums but they are not exactly what I'm needing.

-Thank you
 
Hi,

Lets do it in just two steps...

run the following scheduler code and confirm if its working...
Later we will insert the email routine..or you can do that yourself.


Dim TimeToRun

Sub auto_open()
Call ScheduleEmailing
End Sub

Sub ScheduleEmailing()
timestring = Format(Sheets("sheet1").Range("D7"), "00") & ":" & Format(Sheets("sheet1").Range("E7"), "00") & ":" & Format(Sheets("sheet1").Range("F7"), "00")
TimeToRun = Now + TimeValue(timestring)
Application.OnTime TimeToRun, "Emailing"
End Sub

Sub Emailing()

Workbooks("run-code-every-hour-minute-or-second.xlsm").Activate
'Calculate

Sheets("Sheet1").Range("c1").Value = Sheets("Sheet1").Range("d1").Value

Sheets("Sheet1").Range("D10") = "I am working " & Format(Now, "dd-mmm-yyyy hh:mm AM/PM")
On Error Resume Next
ActiveWorkbook.Save
On Error GoTo 0

Call ScheduleEmailing
End Sub
 
upload_2018-2-24_10-19-47.webp


Please remember your sheet1 must look like this.
 
Back
Top