Hey Everyone,
I'm building a template in Excel that will send an email when they click on a designated email button. The code I'm using now that gets me close to the end result I'm looking for is here:
Sub SendIt()
ActiveWorkbook.SendMail
("myemailaddress@mycompany.com"), Subject:=ActiveSheet.Range("K10:L10")
End Sub
When I click on the button, I get a Microsoft Outlook prompt that says "A program is trying to send an email message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date." ... "For more information about email safety and how you might be able to avoid getting this warning, click Help."
Once this comes up, I click "Allow" and the same message pops up again. If I click allow a second time, I get two emails. if I "Deny" the 2nd or close out of it, then I just get the one I wanted.
To further complicate my request, I get a Microsoft Visual Basic error that says: "Run-time error '1004': General Mail failure. Quit Microsoft Excel, restart the mail system, and try again." with an End and Debug option to select.
So my question would be this:
- I'm looking for a VBA code that will send an email without a worksheet attachment or anything in the body of the email.
- I'm also hoping that whatever option is available will bypass the errors my IT team couldn't quickly figure out as this was a low priority request for them.
For reference, I'm using Office 2013 products.
Thank you for any guidance I can get.
I'm building a template in Excel that will send an email when they click on a designated email button. The code I'm using now that gets me close to the end result I'm looking for is here:
Sub SendIt()
ActiveWorkbook.SendMail
("myemailaddress@mycompany.com"), Subject:=ActiveSheet.Range("K10:L10")
End Sub
When I click on the button, I get a Microsoft Outlook prompt that says "A program is trying to send an email message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date." ... "For more information about email safety and how you might be able to avoid getting this warning, click Help."
Once this comes up, I click "Allow" and the same message pops up again. If I click allow a second time, I get two emails. if I "Deny" the 2nd or close out of it, then I just get the one I wanted.
To further complicate my request, I get a Microsoft Visual Basic error that says: "Run-time error '1004': General Mail failure. Quit Microsoft Excel, restart the mail system, and try again." with an End and Debug option to select.
So my question would be this:
- I'm looking for a VBA code that will send an email without a worksheet attachment or anything in the body of the email.
- I'm also hoping that whatever option is available will bypass the errors my IT team couldn't quickly figure out as this was a low priority request for them.
For reference, I'm using Office 2013 products.
Thank you for any guidance I can get.