Excel to Outlook Appointment

dontasciime

New Member
Joined
May 25, 2010
Messages
7
Hi Everyone,

I am new to this forum and I am really stuck! I have a macro in Excel that automatically emails specified users when any changes have been made to the worksheet.

Now they are asking me to create macro that generates an Outlook Appointment based on the due date in the same Excel sheet. I know that it can be done, but I am not sure how to!

These are the columns where the info is I need to include in the appointment. Ideally, they'd like to see the Subject as Column A, Column C and Column D.

Column A - Number
Column C - Item
Column D - Description
Column N - Due Date

Would anyone be able to help me or tell me where I can find a reference on how to write this code?

Thanks,
d*
 
Tried to use this too and got duplicate entries?
You shouldn't get duplicate appointments if you've set up your data exactly as described by the OP in post no. 1. A subject is constructed from the values of columns A, C and D like this:

subject = .Cells(row, "A").Value & " -- " & .Cells(row, "C").Value & " -- " & .Cells(row, "D").Value

and the code ensures that an appointment with such a subject occurs only once.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Yeah, I'm getting duplicates too. Not sure why, but it's driving me crazy! Maybe because I added in "--" in the subject?
 
Last edited:
Upvote 0
The '--'s in the subject wouldn't cause duplicate, as the whole of the subject text is used to determine if the appointment exists or not. I'm using Excel 2003 and Outlook 2003 and it works for me. The following subroutine sets up some test data on Sheet3 and creates the appointments. Run it twice or more and see if it works for you.
Code:
Private Sub Test()

    Dim row As Long
    Dim subject As String
    
    With Sheet3
        .Activate
        For row = 2 To 6
            .Rows(row).ClearContents
            .Cells(row, "A").Resize(1, 4).Value = Array(row - 1, , "Item" & Chr(row + 63), "Desc" & row - 1)
            .Cells(row, "N").Value = Date + row
        Next
        
        For row = 2 To 6
            subject = .Cells(row, "A").Value & " -- " & .Cells(row, "C").Value & " -- " & .Cells(row, "D").Value
            Update_Appointment subject, .Cells(row, "N").Value
        Next
    End With
        
End Sub
If you're still having problems, I suggest you step through the code in the VB debugger and see if and why it is creating a new appointment every time.
 
Upvote 0
This is crazy. I just can't seem to get this to work. Would I be able to send you my spreadsheet just to see if it works on your machine? I do not understand why this isn't working for me.
 
Upvote 0
Does the test work? Try debugging the code, examining variables to understand how it works and if it isn't working, why.
 
Upvote 0
Hi John_w, your code worked perfectly. I know this is an old post but wanted to thank you for your help!

Dailydud
 
Upvote 0

Forum statistics

Threads
1,223,277
Messages
6,171,150
Members
452,383
Latest member
woodsfordg

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