
Originally Posted by
ragavan.sridar1
do you want the users to enter all the required/correct values and then proceed to email?
Yes that is the intent. Just like how right now if they are missing data when they go to Save the workbook, It will not save until all required data is entered. I want that to be the same with emailing. I don't know if it's giving me trouble because i'm saving to to a temporary file path & name - would that prevent the code from running properly? I have no idea. Stumped on this.
Edit:
Okay, i figured it out but now i have another issue which may be easier to address.
Here is my code:
The bold is what i added to make this work. However, if the user forgets to put a value and hits the Mail button, It won't mail it and will give the error message but then it seems like all my macros and code just die and stop working. So the next time the user hits the Mail button (even if they are missing required data) it will send. The only way to fix this is to physically close excel (not just that workbook). If i have other spreadsheets going at the same time, i have to close those as well. Any way around this? Am i missing something like a Goto or Resume somewhere?
Edit: HAHA. Fixed and solved. Ended up moving the bold portion right below the sub Mail_WO() before i defined my variables. It attempts to save it and if there is anything missing it exits the sub right there.
Thanks for the help ragavan.
Bookmarks