+ Reply to Thread
Results 1 to 10 of 10

Press button, send email

  1. #1
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    Press button, send email

    I need code that essentially copies a cell range (A1:I20) and pastes it as body of an email, as if I had copied and hit control v in the body myself.
    I've seen numerous links but I can't seem to make it work.
    Also, the title will always be "Attendance" and a date referencing from a cell on a different tab (Attendance 2/3/18, for example)
    The button is on a different tab ("Forms") than the target cells. The target cells to copy will be on a hidden tab ("Percap"). Date is on "Cover"

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Press button, send email

    https://www.rondebruin.nl/win/s1/outlook/mail.htm

  3. #3
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    Re: Press button, send email

    I've tried that before. It tells me selection is not a range or the sheet is protected. I set the range to A1:I20 and the sheet is not protected. Here is my code:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Press button, send email

    .
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    Re: Press button, send email

    It still doesn't work, I'm afraid. It thinks the Rng=Nothing still. I can't tell you why, the form is not protected. Your spreadsheet worked fine, so it's not Outlook. What would cause it to think the range is nothing?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Press button, send email

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.
    If posting code please use code tags, see here.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Press button, send email

    Something else is going on with your computer or Excel ... the example project functions as intended here.

    The macro requires that Outlook is installed on your computer ... and ... you will need to establish a default email account within Outlook.

  8. #8
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    Re: Press button, send email

    The sample works on my computer as well. Outlook has a default email set and opens up a new message the way it should after clicking the example button. Here's the file, it's been greatly scaled down. The code in question is in module 66. Also, any tips for condensing those modules? Each one is just a button that prints a range. It takes forever to save.
    Attached Files Attached Files

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Press button, send email

    After downloading your file ... I was able to view just a few of the Modules, including #66. After that, each time I attempted to open any module (even the ones that had opened previously) I would receive an error message indicating ".DLL not available".

    Do you have any reference in your coding that is calling a .DLL ?

    Of the modules I was able to view, it appears each one is printing out a different range of data from the sheets. If they all print out a hard copy (paper) version of the indicated data, why not place all of the print commands into a single
    module and call that single module with one Command Button ? Again, I wasn't able to see all of the modules so my assumptions about the purpose of the modules may be inaccurate.

    Sorry I can't be of more assistance due to the .DLL error message.

  10. #10
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    Re: Press button, send email

    I will try opening it on a different computer tomorrow, and see if there's anything I can find. As far as I'm aware, there is no.dll file being referenced. I didn't make the original spreadsheet, I'm just updating it with numerous improvements to save time closing our cash room. Each of those buttons print out different forms. It really is an impressive spreadsheet. I will report back after I try and open it tomorrow.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-27-2016, 09:39 PM
  2. Send Email when I press "Send" button in Outlook
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2015, 09:37 AM
  3. [SOLVED] On Button Press Send Value to Selected/Active TextBox?
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2015, 01:02 PM
  4. Press submit button and send data to Access
    By Charonix in forum Access Tables & Databases
    Replies: 1
    Last Post: 01-08-2014, 02:34 PM
  5. [SOLVED] Select varying quantity of rows, press macro button to send selection to new workbook
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2013, 10:09 AM
  6. [SOLVED] Press a button to SEND data from one worksheet to another based on conditions set by user
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-21-2012, 10:30 AM
  7. Replies: 17
    Last Post: 05-19-2009, 11:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1