Skip to Content
avatar image
Former Member

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

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.

Regards,
SHUBHAM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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

    Add comment
    10|10000 characters needed 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!