excel vba for sending calendar invite in outlook

blackorchids2002

Board Regular
Joined
Dec 29, 2011
Messages
138
Hi Masters,

Good day! I need your expertise on the how to loop by using range in my excel sheet.
I have check boxes where I assigned the ff:

Check Box1 : Full day ( Date From : input field is found in column D20) and Date To: input in column E20)
Check Box2: Half Day ( Date From : input field is found in column D21) and Date To: input in column E21)
Check Box3: Maternity ( Date From : input field is found in column D22) and Date To: input in column E22)
Check Box4: Bereavement ( Date From : input field is found in column D22) and Date To: input in column E22)


I want the loop code to be applied on ".Start" & ".End" codes below.

If they selected one of the checkboxes, let say Checkbox3, then the loop for ".Start" code should capture the "Date From" column and .End code to "Date To" column.


Sub test ()
Dim oApp As Object, oApt As Object

'to create a clendar invite
Set oApp = CreateObject("Outlook.Application")
Set oApt = oApp.CreateItem(1)

With oApt
.Subject = "PTO REQUEST APPROVED"
.Start = Now()
.End = Now()
.MeetingStatus = 1
.RequiredAttendees = ThisWorkbook.Sheets("PTO Request Form").Range("J8")
.BusyStatus = 3
.AllDayEvent = True
.ReminderSet = False
.Attachments.Add ThisWorkbook.FullName
.Display
.Send
End With

Appreciate all your help on this.

Thanks,
blackorchids2002
 
You should be able to check the value of each check box like this:

Rich (BB code):
Worksheets(1).Shapes("Check Box 1").OLEFormat.Object.Value

If .Value = 1, Then take cell D20's value and apply it to the .Start property, and so on.
 
Upvote 0

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