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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,954
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
FYI, it's Microsoft 365 (formerly Office 365), rather than Windows 365. ;)

Which line is causing the error?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,954
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
So this is an Outlook question, rather than Excel?
 

Drewgarry007

Board Regular
Joined
Oct 1, 2011
Messages
142
it pics up excel files so thought it might be something to do with the files but yes the macro sits in outlook
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,954
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
I've just checked it in Microsoft 365 and the code works fine for me. Perhaps you need to repair Office?
 

Watch MrExcel Video

Forum statistics

Threads
1,133,463
Messages
5,658,928
Members
418,476
Latest member
Tristram_ZX81

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
Top