Direkt zum Inhalt

Wie importiere ich Geburtstage aus Excel in den Outlook-Kalender?

Wenn Sie eine lange Liste mit Geburtstagsinformationen in einem Arbeitsblatt haben, möchten Sie diese Geburtstage jetzt als Ereignisse in Ihren Outlook-Kalender importieren. Wie könnten Sie diese Aufgabe mit einigen schnellen Methoden lösen?


Importieren Sie Geburtstage aus Excel in den Outlook-Kalender mit VBA-Code

Normalerweise gibt es keine direkte Möglichkeit, die Geburtstage in den Outlook-Kalender zu importieren. Hier werde ich einen VBA-Code erstellen, um dieses Problem zu lösen. Bitte führen Sie die folgenden Schritte aus:

1. Öffnen Sie das Arbeitsblatt, das die Geburtstage enthält, die Sie in Outlook importieren möchten, und halten Sie dann die gedrückt ALT + F11 Schlüssel zum Öffnen der Microsoft Visual Basic für Applikationen Fenster.

2. Klicken Sie Insert > Modulund fügen Sie den folgenden Code in das Modulfenster ein.

VBA-Code: Importieren Sie Geburtstage in den Outlook-Kalender

Sub ImportBirthdaysToCalendar()
'Updateby ExtendOffice
Dim xWs As Excel.Worksheet
Dim xRng As Range
Dim xOlApp As Outlook.Application
Dim xCalendarFld As Outlook.Folder
Dim xAppointmentItem As Outlook.AppointmentItem
Dim xRecurrencePattern As Outlook.RecurrencePattern
Dim xRow As Integer
On Error Resume Next
Set xWs = ThisWorkbook.ActiveSheet
Set xRng = Application.InputBox("Please select the data range (only two columns):", "Kutools for Excel", , , , , , 8)
If xRng Is Nothing Then Exit Sub
If xRng.Columns.Count <> 2 Then
  MsgBox "You can only select two columns", vbOKOnly + vbCritical, "Kutools for Excel"
  Exit Sub
End If
Set xOlApp = CreateObject("Outlook.Application")
Set xCalendarFld = xOlApp.Session.GetDefaultFolder(olFolderCalendar)
For xRow = 1 To xRng.Rows.Count
  Set xAppointmentItem = xCalendarFld.Items.Add("IPM.Appointment")
  With xAppointmentItem
    .Subject = xRng.Cells(xRow, 1) & Chr(39) & "s Birthday"
    .AllDayEvent = True
    .Start = xRng.Cells(xRow, 2)
    Set xRecurrencePattern = .GetRecurrencePattern
    xRecurrencePattern.RecurrenceType = olRecursYearly
    .Save
  End With
Next
Set xWs = Nothing
Set xCalendarFld = Nothing
Set xOlApp = Nothing
End Sub

3. Immer noch in der Microsoft Visual Basic für Applikationen Klicken Sie im Fenster Tools > Bibliographie. In der herausgesprungen Referenzen - VBAProject Dialogfeld überprüfen Microsoft Outlook 16.0-Objektbibliothek Option bilden die Verfügbare Referenzen Listenfeld, siehe Screenshot:

4. Dann klick OK um dieses Dialogfeld zu schließen. Jetzt drücken F5 Taste, um diesen Code auszuführen, und eine Eingabeaufforderung erscheint, wählen Sie bitte die Namens- und Geburtstagsspalten aus, siehe Screenshot:

5. Und dann klicken OK Schaltfläche, die Geburtstage werden sofort in den Outlook-Kalender importiert, Sie können Ihr Outlook starten, um das Ergebnis anzuzeigen, siehe Screenshot:


Beste Office-Produktivitätstools

Kutools for Outlook - Über 100 leistungsstarke Funktionen zur Optimierung Ihres Outlooks

🤖 KI-Mail-Assistent: Sofortige Profi-E-Mails mit KI-Magie – geniale Antworten mit einem Klick, perfekter Ton, mehrsprachige Beherrschung. Verwandeln Sie den E-Mail-Versand mühelos! ...

📧 E-Mail Automation: Abwesenheit (verfügbar für POP und IMAP)  /  Planen Sie das Senden von E-Mails  /  Automatisches CC/BCC nach Regeln beim E-Mail-Versand  /  Automatische Weiterleitung (erweiterte Regeln)   /  Begrüßung automatisch hinzufügen   /  Teilen Sie E-Mails mit mehreren Empfängern automatisch in einzelne Nachrichten auf ...

📨 E-Mail-Management: E-Mails einfach abrufen  /  Blockieren Sie betrügerische E-Mails nach Betreff und anderen  /  Doppelte E-Mails löschen  /  Erweiterte Suche  /  Ordner konsolidieren ...

📁 Anhänge ProBatch speichern  /  Stapeltrennung  /  Stapelkomprimierung  /  Automatisches Speichern   /  Automatische Trennung  /  Automatische Komprimierung ...

???? Schnittstellenmagie: 😊Mehr hübsche und coole Emojis   /  Steigern Sie Ihre Outlook-Produktivität mit Registerkartenansichten  /  Ausblick minimieren statt schließen ...

👍 Wunder mit einem Klick: Allen mit eingehenden Anhängen antworten  /   Anti-Phishing-E-Mails  /  🕘Zeitzone des Absenders anzeigen ...

👩🏼‍🤝‍👩🏻 Kontakte und Kalender: Fügen Sie Kontakte aus ausgewählten E-Mails im Stapel hinzu  /  Teilen Sie eine Kontaktgruppe in einzelne Gruppen auf  /  Geburtstagserinnerungen entfernen ...

Auf über 100 Eigenschaften Warten Sie auf Ihre Erkundung! Klicken Sie hier, um mehr zu erfahren.

 

 

Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi Skyyang,

I'm trying to use the code to import the birthdays into a Sharepoint Events List, which is located in my outlook as calendar, but when i run and then select the calendar the recurrances briefly show up and then vanish again right away.
I did successfully import the recurrances into my personal Calendar but I need it to go to the sharepoint calendar to share it with the company :( any ideas?

kind regards
Jonas
This comment was minimized by the moderator on the site
This is very helpful, thank you! Do you have a specific VBA code for the import, but specifically goes to the "Birthday" calendar in Outlook?

Also, now that I've imported to my calendar, is there an easy way to remove all of those inputted, if needed?

Thank you!
This comment was minimized by the moderator on the site
Hello, Sam,
May be the below VBA code can do you a favor:

Sub ImportBirthdaysToCalendar()
'Updateby ExtendOffice
Dim xWs As Excel.Worksheet
Dim xRng As Range
Dim xOlApp As Outlook.Application
Dim xCalendarFld As Outlook.Folder
Dim xAppointmentItem As Outlook.AppointmentItem
Dim xRecurrencePattern As Outlook.RecurrencePattern
Dim xRow As Integer
On Error Resume Next
Set xWs = ThisWorkbook.ActiveSheet
Set xRng = Application.InputBox("Please select the data range (only two columns):", "Kutools for Excel", , , , , , 8)
If xRng Is Nothing Then Exit Sub
If xRng.Columns.Count <> 2 Then
  MsgBox "You can only select two columns", vbOKOnly + vbCritical, "Kutools for Excel"
  Exit Sub
End If
Set xOlApp = CreateObject("Outlook.Application")
'Set xCalendarFld = xOlApp.Session.GetDefaultFolder(olFolderCalendar)
Set xCalendarFld = xOlApp.Session.PickFolder
If xCalendarFld.DefaultItemType <> olAppointmentItem Then
  MsgBox "Please Select calendar folder. ", vbOKOnly + vbInformation, "Kutools for Outlook"
  Exit Sub
End If
For xRow = 1 To xRng.Rows.Count
  Set xAppointmentItem = xCalendarFld.Items.Add("IPM.Appointment")
  With xAppointmentItem
    .Subject = xRng.Cells(xRow, 1) & Chr(39) & "s Birthday"
    .AllDayEvent = True
    .Start = xRng.Cells(xRow, 2)
    Set xRecurrencePattern = .GetRecurrencePattern
    xRecurrencePattern.RecurrenceType = olRecursYearly
    .Save
  End With
Next
Set xWs = Nothing
Set xCalendarFld = Nothing
Set xOlApp = Nothing
End Sub


After running this code, you can create a new folder in the calendar, and the imported birthday will be saved in this new folder, if you need to remove the birthdays, you just need go to this folder, and delete them at once.
https://www.extendoffice.com/images/stories/comments/comment-skyyang/2023-comment/doc-import-birthday.png
This comment was minimized by the moderator on the site
Hi Skyyang,

I'm trying to use the code to import the birthdays into a Sharepoint Events List, which is located in my outlook as calendar, but when i run and then select the calendar the recurrances briefly show up and then vanish again right away.
I did successfully import the recurrances into my personal Calendar but I need it to go to the sharepoint calendar to share it with the company :( any ideas?

kind regards
Jonas
This comment was minimized by the moderator on the site
Hi Skyyang,

I'm trying to use the code to import the birthdays into a Sharepoint Events List, which is located in my outlook as calendar, but when i run and then select the calendar the recurrances briefly show up and then vanish again right away.
I did successfully import the recurrances into my personal Calendar but I need it to go to the sharepoint calendar to share it with the company :( any ideas?

kind regards
Jonas
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations