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:

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, 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
35,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, 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
35,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, 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,102,655
Messages
5,488,116
Members
407,625
Latest member
Alanacran

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top