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
 
Joined
Feb 21, 2018
Messages
216
Reaction score
86
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
 
Joined
Feb 21, 2018
Messages
216
Reaction score
86
upload_2018-2-24_10-19-47.png


Please remember your sheet1 must look like this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top