Error: class does not support Automation or does not support expected interface

antokout

New Member
Joined
Sep 20, 2018
Messages
28
Guys I need help. I run a code on VBA in my work , and on some pc i could run it and on other i couldnt. I read some answers for that error and they said that maybe its service pack for windows i check it and it wasnt . Can someone help me?



Thank you
 
If you mean today's date, since you didn't answer my question, you could use:

Code:
.Cells(i + 2, "C").Value = date
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Then use:

Code:
olItem.Receivedtime

instead of Date.
 
Upvote 0
With ActiveSheet
.Columns("A:B").Clear
.Columns("C").Clear
.Range("A1:B1").Value = Array("Count", "Subject")
.Range("C1").Value = Array("Date")
For i = 0 To dic.Count - 1
.Cells(i + 2, "A") = dic.Items()(i)
.Cells(i + 2, "B") = dic.Keys()(i)
.Cells(i + 2,"C")=olItem.Receivedtime
Next
End With



something like this?
 
Last edited:
Upvote 0
Yes, although you can replace this:

Code:
.Range("A1:B1").Value = Array("Count", "Subject")
.Range("C1").Value = Array("Date")

with this:

Code:
.Range("A1:C1").Value = Array("Count", "Subject", "Date")
 
Upvote 0
Yes, although you can replace this:

Code:
.Range("A1:B1").Value = Array("Count", "Subject")
.Range("C1").Value = Array("Date")

with this:

Code:
.Range("A1:C1").Value = Array("Count", "Subject", "Date")



yes but with this, it shows error in this line .Cells(i + 2,"C")=olItem.Receivedtime
 
Upvote 0
There is no way that change could affect the line you just posted.
 
Upvote 0
Run time error '91'
Object variable or with block variable not set and on debug shows me this line .Cells(i + 2,"C")=olItem.Receivedtime
 
Upvote 0
What do you want the code to do if there are emails with the same subject but different dates?
 
Upvote 0
Just to put the date that email received with the same subject . I quess if the counter wrote 4 emails with the same subject then next to the subject put the last email received date
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,051
Members
452,542
Latest member
Bricklin

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