How to put an excel submittal form on the internet to email?

Amorous

New member
Joined
Aug 19, 2011
Messages
6
Reaction score
0
Points
0
I have an Excel form used for employees to enter their bonuses. I want this form to be online so they can enter their information and hit “submit” and it will be delivered to me via email. I have domain that is hosted by a company. Can anyone give me step-by-step instructions?

The Form is attached
 

Attachments

  • Bonus Sheet.xls
    130.5 KB · Views: 532
Okay, so here's how it works... (VBA code courtesy of Ron deBruin's site at http://www.rondebruin.nl/mail/folder2/mail1.htm)

When you're in Excel:
  • Press Alt+F11 to enter the VBA editor
  • If you don't see a tree browser at left press CTRL+R to display it
  • Drill down into your workbook
  • Right click "Microsoft Excel Objects" (or something else within your workbook)
  • Choose Insert-->Module
  • In the pane that opens, paste in the following code:
Code:
Sub Mail_Workbook_Outlook()
'Sends the last saved version of the Activeworkbook
    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next
    With OutMail
        .To = "youremail@yourdomain.com"
        .CC = ""
        .BCC = ""
        .Subject = "Put your subject here between the quotes"
        .Body = "If you'd like to send a message, type that between the quotes here"
        .Attachments.Add ActiveWorkbook.FullName
        .Send   'or use .Display if you'd to test it without sending
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

  • Close the VBA Editor
  • On the Developer Tab, choose Insert-->Form Control-->Button
  • Drag a button onto the worksheet
  • When it pops up and asks you to assign a macro, choose "Mail_Workbook_Outlook"
At that point, you should be good to go.

If you need any further help, let me know.
 
Glad to help!

Ken, I used your code above and it was very helpful to me. I was wondering if there is a variation of his code where the user of the form would not have to save the form before the submitted it. The problems am having is that people are forgetting to save the form before they hit submit. So I am getting blank or partially filled out forms emailed to me. Is I possible to have the code altered so that when they hit submit it send me whatever the have currently filled out even if hey did not hit save first? Thanks!
 
Back
Top