+ Reply to Thread
Results 1 to 8 of 8

Form Validation and Insert Object Questions

  1. #1
    Registered User
    Join Date
    08-08-2017
    Location
    Colombia, Medellin.
    MS-Off Ver
    2013
    Posts
    13

    Question Form Validation and Insert Object Questions

    Hi there fellas,

    I'm not that versed in excel let alone VBA, but I usually search for what I need (formulas and macros) and get it done, as most of the stuff I do in excel is rather simple. I've been searching online for a couple of hours now but I couldn't find what I need.

    I pretty much need a validation message for a form (plenty of info and videos on this) however I'm not using the "Form" command - which I believe is mostly used for data entry, I created text boxes and a couple of buttons as this will be a unique form completed once by the person that receives it.

    1. With that said need a macro that generates a single message if any of the text boxes is empty and to color which ones are empty
    2. I also need a macro to attach documents into excel (pdf, jpg, etc.) I got one on the file I attached that worked to browse files but other users cant open the objects. Having the objects on a particular cell instead of the active cell would be ideal. If this is complicated maybe a button that attach embedded documents (using the macro I already got) along with the excel form into an email could do the trick. The embed file question has been solved.

    Edit: wording to make it easier to understand.

    Thanks in advance for the support and sorry if I'm asking for too much!
    Attached Files Attached Files
    Last edited by CristianCGP; 01-27-2020 at 09:06 AM.

  2. #2
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    249

    Re: Form Validation and Insert Object Questions

    Hi Cristian,

    I should be able to solve your validation issue later tonight. Not sure if I can help on your other issue but if I can will attempt there too.

  3. #3
    Registered User
    Join Date
    08-08-2017
    Location
    Colombia, Medellin.
    MS-Off Ver
    2013
    Posts
    13

    Re: Form Validation and Insert Object Questions

    Quote Originally Posted by liquidmettle View Post
    Hi Cristian,

    I should be able to solve your validation issue later tonight. Not sure if I can help on your other issue but if I can will attempt there too.
    Thanks! I appreciate the support.

  4. #4
    Registered User
    Join Date
    08-08-2017
    Location
    Colombia, Medellin.
    MS-Off Ver
    2013
    Posts
    13

    Re: Form Validation and Insert Object Questions

    Bumping thread up

  5. #5
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    249

    Re: Form Validation and Insert Object Questions

    Hi Cristian,

    Thanks for bumping it, life got in the way and it slipped my mind to come back to your thread (apologies)!

    I'll take some time by tomorrow to send what I think should be a fix for your validation problem, but I wanted to ask about your 2nd part:

    I also need a macro to attach documents into excel (pdf, jpg, etc.) I got one on the file I attached that worked to browse files but other users cant open the objects. Having the objects on a particular cell instead of the active cell would be ideal. If this is complicated maybe a button that attach embedded documents (using the macro I already got) along with the excel form into an email could do the trick.
    Your macro to attach objects seems to work fine to me...it puts them in random places all over, but I was able to open the 2 I test-attached as well as the one you had attached before uploading your document (the PDF invoice for Service Cloud Lightning CRM -Unlimited ...). They might not have been able to open them because design mode was active in the version you attached (not sure).

    For future reference, you might consider using a user form (much easier for validation purposes), but Ill get back to you soon with an attempt.
    Last edited by liquidmettle; 01-24-2020 at 11:08 PM.

  6. #6
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    249

    Re: Form Validation and Insert Object Questions

    Hi Christian,

    Your validation issue should be taken care of in the attached file. It will require some copy-pasting for you to flesh it out fully, but it will prevent a save if they have not filled out certain fields.

    The code:
    Please Login or Register  to view this content.
    This was placed in the "ThisWorkbook" module. All you need to do is replicate the if/then statement and change the name of the textbox and the field name in the message box message to match.

    Important: to prevent yourself from going crazy once you write all the other validation code statements, put the workbook into "Design Mode" to save it yourself. This will allow you to save without filling out all the fields you require from end users.

    I took the liberty of putting your save buttons at the top and using freeze panes to fill out the form. I think this makes it easier when they are getting ready to save to scroll to the field to try again.

    I tried to take a stab at your file placement but I came up short there. Here's what you want to do (and maybe someone else can help): You want every file placed to look at column C, select the first blank row in column C, then select it before creating the new file object. Whether you have each file write some value into the column so it can find the next cell or if it goes by the range occupied by the object, I'm not sure what would be best. Unfortunately I can describe that process but wasnt able to get the code to do what I described (my own failing, but very possible to achieve).

    Anyways hope this helps, let me know if you have questions on the validation part.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-08-2017
    Location
    Colombia, Medellin.
    MS-Off Ver
    2013
    Posts
    13

    Re: Form Validation and Insert Object Questions

    Hey man! I really appreciate the time! while this works, I found it generates tons of messages, I'd prefer something that generates a single message if any of the text boxes is empty and to color which ones are empty, does that make sense?
    Last edited by CristianCGP; 01-27-2020 at 08:48 AM.

  8. #8
    Registered User
    Join Date
    08-08-2017
    Location
    Colombia, Medellin.
    MS-Off Ver
    2013
    Posts
    13

    Re: Form Validation and Insert Object Questions

    Quote Originally Posted by liquidmettle View Post
    For future reference, you might consider using a user form (much easier for validation purposes), but Ill get back to you soon with an attempt.
    I was wondering what are your thoughts on this, everything I found on forms were more for data entry instead of a document that needs to be completed a single time (does that make sense?) i.e https://www.youtube.com/watch?v=cNpFB8M1-dI&t= but I wanted something that "looked" more professional.

    Also, I like the changes you made, it does looks better!
    Last edited by CristianCGP; 01-27-2020 at 08:47 AM.

+ 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. VBA Insert PDF File as an Object using User Form
    By Eng.Hashem in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2015, 08:12 AM
  2. Replies: 0
    Last Post: 06-19-2014, 02:09 PM
  3. VBA for data validation --> Method 'Add' of object 'Validation' failed
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2010, 06:18 AM
  4. Very Basic Excel Object Questions
    By BiilyJoeBob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2005, 02:05 AM
  5. A couple RTD related questions, plus VBA timer object
    By blindbl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2005, 11:07 PM
  6. Form questions
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-16-2005, 07:06 PM
  7. [SOLVED] Further Form Questions
    By Stuart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2005, 01:06 PM

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