Skip to Content
Jul 04, 2019 at 03:10 PM

Planning Function Macro Error Message


Hi Guys

I assigned a Planning Sequence and a Plandatasave command to one button.

Sub Button1002_Click()

Dim lResult As Long

Dim lResult1 As Variant

lResult = Application.Run("SAPExecutePlanningSequence", "PS_1")

lResult = Application.Run("SAPExecuteCommand", "PlanDataSave")

End Sub

Unfortunately if an error occurs during the execution of the planning function the error message doesn't show up. It finally runs the Plandatasave functionality. If I run the Planning function on its own it shows the whole error message.

Does anyone knows how I can catch the entire error message of the Planning function and show it?

Sure, I could divide the execution of Planning function and Plandatasave to 2 different buttons. But the end user wants both functionalities in one button.