Updated to Microsoft 365 and now have a issue

Drewgarry007

Board Regular
Joined
Oct 1, 2011
Messages
142
Hi,

I have upgraded my PC to windows 365 and now get a 'Object library feature not supported' error when running the below macro. I have edited the email addresses, texts and file paths. the files the macro picks up are created and saved daily so these would be the first files saved down using windows 365:
Code:
Public Sub CreateNewMessage()
Dim objMsg As MailItem

Set objMsg = Application.CreateItem(olMailItem)

With objMsg
  .To = "Email addressl"
  .CC = "Email address"
  '.BCC =
  .Subject = "Super " & Format(Now, " ddmmmyy")
  .Categories = "Test"
  .VotingOptions = "Yes;No;Maybe;"
  .BodyFormat = olFormatPlain ' send plain text message
  .Importance = olImportanceHigh
  .Sensitivity = olConfidential
  .Attachments.Add ("Z:\file path" & Format(Now, " ddmmmyyyy") & ".xlsx")
  .Attachments.Add ("Z:\file path" & Format(Now, " ddmmmyyyy") & ".xlsx")

 
' Calculate a date using DateAdd or enter an explicit date
  .ExpiryTime = DateAdd("m", 6, Now) '6 months from now
  .DeferredDeliveryTime = #8/1/2012 6:00:00 PM#
  .Body = "Hi," & vbNewLine & vbNewLine & _
              "text" & Format(Now, "ddmmmyyyy.") & vbNewLine & vbNewLine & _
              "Thanks," & vbNewLine
  .Display
End With

Set objMsg = Nothing

End Sub
Any ideas??
 
Last edited by a moderator:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
FYI, it's Microsoft 365 (formerly Office 365), rather than Windows 365. ;)

Which line is causing the error?
 
Upvote 0
So this is an Outlook question, rather than Excel?
 
Upvote 0
it pics up excel files so thought it might be something to do with the files but yes the macro sits in outlook
 
Upvote 0
I've just checked it in Microsoft 365 and the code works fine for me. Perhaps you need to repair Office?
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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