Facebook Twitter Instagram
    Trending
    • Hard Drive Repair After Wrong Voltage Mishap
    • How To Send Excel Workbook As Email Using Button
    • Compare EV Chargers
    • Home Assistant Server Monitoring
    • Mitsubishi Outlander Dash Cam Install
    • Left or Right Pad a String with a VBScript Function
    • List Files in a Folder Using VBScript
    • How to Verify Checksum of a File
    RSS Twitter Instagram Facebook Pinterest YouTube
    Technology Spy
    • Tutorials & Help
    • Reviews
    Technology Spy
    You are at:Home»Excel»How To Send Excel Workbook As Email Using Button

    How To Send Excel Workbook As Email Using Button

    0
    By Matt on March 22, 2022 Excel, General, Microsoft Office

    There are a number of techniques for sending an Excel Workbook to someone via email. In this post I’ll show how to send the file via email using a Button and some basic VBA script. This allows the user to enter information into the sheet and click a button to send it to a recipient.

    Here is a function called EmailFile. It sends the whole Worksheet to the recipient whose address is defined by the “strRecipients” variable. You will need to update this variable and insert the email address you want to send to.

    Sub EmailFile()
    strSubject = "Feedback Form"
    strRecipients = "firstname.surname@example.com"
    ActiveWorkbook.SendMail Recipients:=strRecipients, _
    Subject:=strSubject
    End Sub
    

    Here is slightly more advanced version of the function. It uses an array to define a list of recipients so you can send to multiple people.

    Sub EmailFile()
    
    Dim strSubject As String
    Dim strRecipients As Variant
    
    strSubject = "Feedback Form"
    strRecipients = Array("a.b@example.com", "x.y@example.com")
    
    ActiveWorkbook.SendMail Recipients:=strRecipients, _
                            Subject:=strSubject
    
    End Sub
    

    Hopefully you’ll find this technique for sending excel workbooks via a button useful.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleCompare EV Chargers
    Next Article Hard Drive Repair After Wrong Voltage Mishap

    Related Posts

    Hard Drive Repair After Wrong Voltage Mishap

    Compare EV Chargers

    Mitsubishi Outlander Dash Cam Install

    Leave A Reply Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Recent Posts
    November 20, 2022

    Hard Drive Repair After Wrong Voltage Mishap

    March 22, 2022

    How To Send Excel Workbook As Email Using Button

    January 30, 2022

    Compare EV Chargers

    Categories
    • 3D Printing
    • Android
    • Arduino
    • Development
    • ESP8266
    • Excel
    • Gaming
    • General
    • GIMP
    • Home Automation
    • JavaScript
    • Linux
    • Microsoft Office
    • Mobile Devices
    • Oracle APEX
    • Python
    • Raspberry Pi
    • Reviews
    • Security
    • SharePoint
    • Tutorials & Help
    • VBScript
    Tags
    Android APEX Apple Arduino Black Friday csv Elite Dangerous email ESP-01 ESP8266 EV Excel file handling gaming GIMP Gritin Home Assistant Home Automation IMNEED Joystick Linux lists Lumsing Media os.stat os.walk Phishing Power Python Qi Review scam Security select SharePoint 2010 string Syncwire text text files TrueCrypt Ubuntu USB-C VBA VBscript Windows 10
    Web Tools

    A set of quick and basic online tools for web designers and software developers :

    • Hash Generator
    • Text to HTML List
    • Text to HTML Table
    • URL Encoder and Decoder
    • UNIX Timestamp Calculator
    • LED Resistor Calculator
    • Extract Email from Text
    • Mortgage Calculator
    About

    Welcome to Technology Spy, a site devoted to gadgets, computers, programming and all things technology! You’ll also find product reviews for items I own as well as tutorials, guides and scripts for the software I use.

    Archives
    Other Resources
    • MattsBits
    • Raspberry Pi Spy
    Facebook Twitter Instagram Pinterest

    Entries RSS | Comments RSS

    Copyright © 2022 - All Rights Reserved - Matt Hawkins

    mastodon.social@MattHawkins

    Type above and press Enter to search. Press Esc to cancel.