+ Reply to Thread
Results 1 to 18 of 18

Is it possible to save data entered in a userform to an external (unopened) excel file?

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Is it possible to save data entered in a userform to an external (unopened) excel file?

    I am currently trying to find a way to have data entered in a userform saved in an unopened excel file. At the moment I have the data going into a second sheet in the same file, but I would really like it saved in separate file. Is this possible? If so, how would I go about doing so?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    mrapes,

    Assuming your userform has a Submit (or similar) button, it would look somthing like this:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Thank you. I will have to try that. Also, do you know how to send an email with a range of cells included from that external excel file? This is what I have right now to pull from the current file.


    Please Login or Register  to view this content.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Not quite sure how you want it formatted, but here you go:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    The first set of code worked amazingly! Thank you so much. The second set (with regards to email) still pulls from my current excel file instead of the one that I placed the data in.

    -Melanie

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Change this line:
    Please Login or Register  to view this content.

    To this instead:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Just to note, you'll have to do that before the wbDest.Close line

  8. #8
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    That won't work. Get run-time error '424' Object Required

  9. #9
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Sorry, I missed your last post. It still isn't working though. There error I get now is "Run-time error '-2147417848 (80010108)': Method 'MailEnvelope' of object '_Worksheet' failed"
    -Melanie

  10. #10
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    I am unable to duplicate that error. Can you post a sample file that is experiencing the issue?

  11. #11
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Here is the code I am using that gets the error.
    Attached Files Attached Files

  12. #12
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Using your attached workbook, I was able to save to the external file, create the message from the data that was written to it, and send the email with no errors, using this code:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    That works great! thank you so much!! Now how do I not have the button in email when I send it?

  14. #14
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    I'm afraid that I'm not entirely certain what you mean. I think you can comment out (or delete) this line:
    Please Login or Register  to view this content.


    If that doesn't fix it, can you explain more what you mean?

  15. #15
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    That did not do the trick. When I use the exact code that you sent me, it places the button that brings up the userform in my email.

  16. #16
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    I do not get that issue using the code I provided, so I'm not sure what's causing that

  17. #17
    Registered User
    Join Date
    06-07-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    Ok. Well thank you very much. This problem really isn't that big of a deal. You solved most of my problems!

  18. #18
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: Is it possible to save data entered in a userform to an external (unopened) excel file

    I found this code works great for sending e-mail.

    Please Login or Register  to view this content.

+ 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