BeforeSend event / Before Send event - Can anybody help me?

antaeusguy

Board Regular
Joined
Mar 8, 2010
Messages
81
Hi

I've a macro file which is a request form.

I've programmed it in the BeforeSave event so that User cannot save if mandatory fields are incomplete before e-mailing to me.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'This event will trigger a incompleteness check
(Codes goes here)
End Sub


However, I found User was able to bypass this check and I received incomplete forms.

I doubled checked my code and I wasn't able to save if I've incomplete information, i.e. mandatory fields are not filled in.

I asked the User how does she bypass it, and she says she goes to File > Save & Send > Send using e-mail > Send as attachment and Excel did not perform the check!

I was nervous when I found out about this loop hole...

Does anyone knows how to prevent this from happening?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
if you set your form up on a userform, you could manage your problem more easily i would think.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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