Excel 运行时错误';440';-对象不支持此方法
我在运行宏向客户发送发货订单电子邮件时遇到了这个问题。它似乎是完全随机的,没有遵循任何模式。代码有问题吗?我必须检查代表发送的邮件,因为我需要它来显示电子邮件来自主管理员帐户,但VBA会在崩溃时突出显示指定的.行作为问题。这是密码,有人能告诉我我做错了什么吗Excel 运行时错误';440';-对象不支持此方法,excel,vba,Excel,Vba,我在运行宏向客户发送发货订单电子邮件时遇到了这个问题。它似乎是完全随机的,没有遵循任何模式。代码有问题吗?我必须检查代表发送的邮件,因为我需要它来显示电子邮件来自主管理员帐户,但VBA会在崩溃时突出显示指定的.行作为问题。这是密码,有人能告诉我我做错了什么吗 Sub EmailRep() Do With Application .DisplayAlerts = False .ScreenUpdating = False Sheets("Email").Select
Sub EmailRep()
Do
With Application
.DisplayAlerts = False
.ScreenUpdating = False
Sheets("Email").Select
End With
Dim sDESIGNATED As String
sDESIGNATED = [C100]
Range("A2:D35").SpecialCells(xlCellTypeVisible).Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.To = sDESIGNATED
.Item.Subject = "Your Order Has Shipped!"
.Item.SentOnBehalfOfName = "me@me.com"
.Item.Send
End With
ActiveWorkbook.EnvelopeVisible = False
With Application
.DisplayAlerts = True
.ScreenUpdating = True
Sheets("Orders").Select
Rows("2:2").Select
Selection.Copy
Sheets("Sent").Select
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Orders").Select
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Range("A2").Select
End With
Loop Until ActiveCell.Value = ""
End Sub
.SentOnBehalfOfName
是Outlook邮件项目的属性。我不确定您是否可以使用MailEnvelope
。欢迎使用SO!请拿着这本书读一读!以及为什么要避免,并且.SentOnBehalfOfName
是Outlook邮件项目的属性。我不确定您是否可以使用MailEnvelope
。欢迎使用SO!请拿着这本书读一读!为什么要避免和