【发布时间】:2017-11-03 11:56:51
【问题描述】:
下面的代码完全可以满足我的需要,除了我希望.To 从“A1”开始的特定工作表“电子邮件列表”中拉入一个数组。我在此代码中添加或减去的所有内容都会导致代码停止。任何帮助都非常感谢。
Dim AWorksheet As Worksheet
Dim Sendrng As Range
Dim rng As Range
On Error GoTo StopMacro
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set Sendrng = Worksheets("Daily Notes").Range("A1:M67")
Set AWorksheet = ActiveSheet
With Sendrng
.Parent.Select
Set rng = ActiveCell
.Select
ActiveWorkbook.EnvelopeVisible = True
With .Parent.MailEnvelope
.Introduction = "Daily Notes *ad items are in bold*"
With .Item
.To = ""
.CC = ""
.BCC = ""
.Subject = "Daily Notes"
.Send
End With
End With
rng.Select
End With
AWorksheet.Select
StopMacro:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveWorkbook.EnvelopeVisible = False
End Sub
【问题讨论】:
-
“我在这段代码中添加或减去的所有内容都会导致代码停止。” - 你到底加或减了什么?
-
尝试不同的配置来找到解决方案 - 到目前为止还没有。