How to prevent from saving if some cells + textbox + combobox are blank ?

francois.lemarie

Board Regular
Joined
Mar 24, 2010
Messages
54
<TABLE class=tborder id=post2269902 cellSpacing=0 cellPadding=6 width="100%" align=center border=0><TBODY><TR vAlign=top><TD class=alt2 style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 0px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 0px solid" width=175></TD><TD class=alt1 id=td_post_2269902 style="BORDER-RIGHT: #ffffff 1px solid"><!-- report button -->
<!-- / icon and title --><!-- message -->Hello
I am preparing a template with different sheets that users will have to fill in. I use cells and 2 activeX controls (textboxes and comboboxes):

I would like the users cannot be able to save the template if the following elements are blank:
-specific cells (eg. A1 in sheet1, A2 in sheet2)
-textboxes (eg Textbox1 in sheet1, Textbox2 in sheet2)
-comboboxes (eg. Combobox1 in sheet 1, Combobox2 in sheet2)

However, these specific cells, textbox and comboboxes blank must appear in blank when they will open it. So it implies to be able to save a file with it blank ONLY IF YOU KNOW THE PASSWORD (As the creator of the template, I would be the only person to know it). If you don't know the password you have to complete cells, textboxes and comboboxes to be able to save.


I thought about a message before saving for example : "Some elements are blank, please check it all, or enter the password to save with blanks" and a little space to put the password. If the password is not the good one another message would appear : "Please put correct password or fill the blanks". I am a newbie so if you have another idea, please be free to purpose !

Would anybody be kind to tell me how to do it ? ?

Even partial answers would be appreciated.

Regards,

Francois
</TD></TR></TBODY></TABLE>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
check your cells/Textboxes/Combo boxes on beforesave event of workbook - if condition is true then save the file else exit sub,
check the password before saving the workbook

Clear desired cells/textboxes/combo boxes on workbook open event.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top