"Calendrier" is language-dependent - it should work in French-language Outlook but not in other languages.
olFolderCalendar, on the other hand, is a symbolic constant that will work in all languages. So it's much safer to use that.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
From a VBA Excel macro, I use these two instructions to create a calendar in the group 'My calendars' of Outlook (theses instructions create and respectively get to an existing calendar of Outlook). They work fine on Office2016 :
To create a calendar:
Set myCalendar = namespaceOutlook.Folders(MyOutlookMail).Folders("Calendrier").Folders.Add(CalendrierName)
Or get to it if it exists:
Set myCalendar = namespaceOutlook.Folders(MyOutlookMail).Folders("Calendrier").Folders(CalendrierName)
These instructions don't work anymore on Office365. After many tries, I found out I had to use this instead:
Set TatooCalendar = namespaceOutlook.GetDefaultFolder(olFolderCalendar).Folders.Add(CalendrierName)
and
Set TatooCalendar = namespaceOutlook.GetDefaultFolder(olFolderCalendar).Folders(CalendrierName)
For what ? and is the workaround I found correct please? Thank you....
"Calendrier" is language-dependent - it should work in French-language Outlook but not in other languages.
olFolderCalendar, on the other hand, is a symbolic constant that will work in all languages. So it's much safer to use that.