I followed these instructions to convert from early to late binding: Convert Early Binding VBA to Late Binding VBA : Excel to Outlook Contacts
The code was working with early binding but now comes up with
Run-time error '5': invalid procedure call or argument
on the following line:
Set SentItemsFolder = myNamespace.GetSharedDefaultFolder(myRecipient, olfolderinbox).Parent.Folders("Sent Items")
I tried
dim olfolderinbox as object