首页 > 解决方案 > 为什么附件方法不能正常工作

问题描述

我在运行该方法时遇到问题.Attachment.Add

For i = 1 To 2

ThisWorkbook.Sheets("Resumen").Range("F5").Value = i
ActiveWorkbook.EnvelopeVisible = True

With ActiveSheet.MailEnvelope

   .Item.To = ThisWorkbook.Sheets("Resumen").Range("B6").Value
   .Item.Subject = ThisWorkbook.Sheets("Resumen").Range("B5").Value
   .Attachment.Add ThisWorkbook.Sheets("Resumen").Range("B7").Value 'THIS LINE SHOW THE MISTAKE, "the object does not admit the method
   .Introduction = "RESUME"
   .Item.Send

End With

ActiveWorkbook.EnvelopeVisible = False
Next i

End Sub

需要根据范围值附加文件吗?

非常感谢。

标签: excelvba

解决方案


推荐阅读