+ Reply to Thread
Results 1 to 10 of 10

VBA Userform - When submitted by email the attachment is blank.

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question VBA Userform - When submitted by email the attachment is blank.

    Hi

    I am very new to VBA and I am trying to create a userform which can be filled in and then when command button "submit" is clicked the completed form is emailed to myself. I have created the code for this but the userform is arriving as a blank attachment. As anybody had this problem before? if so could you please help?

    Below is the code i am using

    Many Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Userform - When submitted by email the attachment is blank.

    You cannot email a form, you need to save the input to a sheet which can be emailed, is that what you are doing/
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: VBA Userform - When submitted by email the attachment is blank.

    Hi royUK, thanks for helping. My trainer advised me i could create a form and this form could be sent as an attachment. I used the code he sent me and although the userform does get sent, the form appears blank when opened. Can it not be done sending a complete form by email?

    Any advise on how to proceed please?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Userform - When submitted by email the attachment is blank.

    The workbook containing the form can be emailed as an attachment, the data input into it will not be in the form

    I would create a form on the sheet not a UserForm

  5. #5
    Registered User
    Join Date
    05-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: VBA Userform - When submitted by email the attachment is blank.

    Thanks, Do you mean build the form within excel not using VBA?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Userform - When submitted by email the attachment is blank.

    Quote Originally Posted by Castiel View Post
    Thanks, Do you mean build the form within excel not using VBA?
    Yes, then use VBA to email the sheet. Ideally I would use code to send the form as a pdf or HTML

  7. #7
    Registered User
    Join Date
    05-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: VBA Userform - When submitted by email the attachment is blank.

    Thanks royUK, could you advise me of the code i should be using to get a pdf document or should i run a macro of me saving and emailing the document?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Userform - When submitted by email the attachment is blank.

    One step at a time. You need to decide what you are doing about the form

  9. #9
    Registered User
    Join Date
    05-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: VBA Userform - When submitted by email the attachment is blank.

    I have created the form in excel now and have put a button on the page. I want this button when clicked to send the document as an attachment to my email address. Is it a case of using the same code i had at the start of my thread?

    Appreciate the help.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA Userform - When submitted by email the attachment is blank.

    It should be.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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