Excel crashing when emailing ranges

30 pts.
Tags:
Microsoft Excel
Visual Basic
Hello, I have created a worksheet for my company that covers all areas of our business. I have inserted ActiveX buttons allowing me to email only certain cell ranges directly to the body of the receiving email address. I have also created a terms and conditions box as well as contact information, these need to be added to all out going emails. I have no problem emailing the one set of selected ranges, IE ("B73:L116"), however when i try to add in my other ranges to the same VB Code, it is crashing both Excel and Outlook. Please could anyone let me know what i might be doing wrong. I have only really been using Excel to this extent for a few months so any basic talk would be extremely helpful. Thank you all very much in advance.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Post your code and let us take a look. It's most likely a formatting issue.
    132,760 pointsBadges:
    report
  • Peanut4

    Hi Todd,

    Thank you for replying to me. Please see my code below:


    Private Sub CommandButton1_Click()
    MsgBox "have you read our terms and conditions?"
     ActiveSheet.Range("B73:L116").Select
      
       ActiveWorkbook.EnvelopeVisible = True

       With ActiveSheet.MailEnvelope
          .Introduction = "Please see my account opening request form below, i look forward to hearing from you."
          .Item.To = "accounts@mycompany.com"
          .Item.Subject = "Account Opening"
          .Item.Send
       End With
    End Sub

    Any help you can offer will be much appreciated. 

    Kind regards,

    30 pointsBadges:
    report
  • Peanut4

    When i try to nest ranges ("O43:AH51,Y73:AC91) - which are the T&C's and Contact Info ranges, the problems start.  It seems like it wants to send, however it doesnt get far enough to actually find out.

    Thank you again

    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: