Save Meta Data in new workbook

Satheesh Miryala

New Member
Joined
Jun 9, 2017
Messages
3
Hi Forum,

I am working on a checklist project where i am suppose to create a checklist which sends automatic emails when the checkbox is checked from each row. i could able to create the VBA code and it runs perfectly. Now, i got the extra requirement where i need to save the Meta Data in a new excel workbook and save in the shared path on daily basis as per date and a consolidated sheet to be prepared which merges the data as the days go on.

The Meta Data columns are Email Sender Name, Assigned SLA for Sending email, Actual Time Stamp of email sent, Difference between the actual and assigned.

Could someone help me on this please.

My Code for email automation is :

Sub reminder1()
Dim lRow As Integer
Dim i As Integer
Dim toList As String
Dim eSubject As String
Dim eBody As String
Dim olNamespace As Outlook.Namespace




With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With


Sheets(1).Select
lRow = Cells(Rows.Count, 4).End(xlUp).Row


For i = 2 To lRow
For Each oleControl In Sheets("Sheet1").OLEObjects
If Range(oleControl.TopLeftCell.Address).Row = i Then
If oleControl.Object.Value = True Then


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Set olNamespace = Outlook.GetNamespace("MAPI")
toList = Cells(i, 3) 'gets the recipient from col B
eSubject = "Bonus Assignment"

eBody = "Hello All" & "," & vbNewLine & vbNewLine & _
"This is to remind you that the following task " & Cells(i, 6) & " " & "has been completed" & vbNewLine & vbNewLine & _
"Thanks & Regards" & vbNewLine & _
olNamespace.CurrentUser
On Error Resume Next
With OutMail
.To = toList
.CC = ""
.BCC = ""
.Subject = eSubject
.Body = eBody
.Display
'.Send
End With


On Error GoTo 0
Cells(i, 7) = "Mail Sent " 'Marks the row as "email sent in Column A"
Cells(i, 8).Value = olNamespace.CurrentUser
Cells(i, 9).Value = Date + Time
Set OutMail = Nothing
Set OutApp = Nothing
End If
End If
Next oleControl
Next i


ActiveWorkbook.Save


With Application
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
End With
End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top