Skip to Content

How do I stop a package from getting triggered in after_save() function when no data is saved

Nov 28, 2016 at 11:01 AM


avatar image
Former Member

Hi Experts,

We have provided a SAVE button to the user in the input template which is assigned to the standard macro to save data.

In after_save() function we are triggering a package when the user inputs through the particular template sheet.

Issue is that when user clicks accidently on SAVE button, then with no changed data, message appears that there is no data to save, but after this the package configured in AFTER_SAVE function gets triggered.

Now user does not want this feature. I am looking for way to avoid package triggering when there is no data to save.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Vadim Kalinin Nov 28, 2016 at 12:57 PM

You can always check if there is the data to save using:

Function GetReportsDataCountToSubmit(sheet As Worksheet) As Long

Show 1 Share
10 |10000 characters needed characters left characters exceeded

But I do not understand why after_save event will trigger? This event will not happen if there is no data to save.

Looks like you have done some mistakes in the code. Please show full code!