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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,224,753
Messages
6,180,748
Members
452,996
Latest member
nelsonsix66

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