User-defined type not defined with vba to Outlook

Joined
Oct 18, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello, I am getting an error when I type the command for dimming something as an Outlook mail item. The command I am trying to do is:
Dim MyEmail As Outlook.MailItem

Let me know how to fix! Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Check your references (Tools>References in vb editor). You'd need a reference to Outlook library. If you can get by with late binding I wouldn't know - have never tried, have always set the reference.
 
Upvote 0
Check your references (Tools>References in vb editor). You'd need a reference to Outlook library. If you can get by with late binding I wouldn't know - have never tried, have always set the reference.
Hello, I am still getting the error even though I have the right references selected.
 
Upvote 0
I have never seen this issue be anything else so all I can suggest is that you could run the following code from inside a standard module and copy/paste the resulting list into a post. Might be prudent to post your code as well. Please post code within code tags (use vba button on posting toolbar).
VBA Code:
Sub RefsList()
Dim ref As Reference

For Each ref In ThisWorkbook.VBProject.References
     Debug.Print ref.Name
Next

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,824
Messages
6,127,092
Members
449,358
Latest member
Snowinx

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