vba - Out of stack space Error -


I almost snippet this code, in which I should count yesterday morning, Thursday, Saturday and Sunday. . 2 date limitations are highlighted in the line "Skies = Modewedde (Notification, Order Date, Placement Date, Release Date)" and error box says error '28' outside the stack space. Can anyone help me here?

  '////// This delay is for the valley estimate of the days ///////////// Public Function Mode Wade (ByRef NotificationDate as the date , as of the date of ByRef OrderDate, ByRef PlacementDate date as, ByRef RELEASEDATE date) as integer as as integer dim integer gives dim WeekendDays left as integer dim WeekendDays2 'skip = 0 WeekendDays = 0 WeekendDays2 = 0 does NotificationDate & lt; = OrderDate If DatePart ( "w", NotificationDate) = 0 Then WeekendDays = WeekendDays + 1 elseif DatePart ( "w", NotificationDate) = 2 then WeekendDays = WeekendDays + 1 elseif DatePart ( "w", NotificationDate) = 4 then WeekendDays = WeekendDays + 1 elseif DatePart ( "w", NotificationDate) = 6 then WeekendDays = WeekendDays +1 finally NotificationDate = DATEADD ( "D", 1, NotificationDate) loop to PlacementDate & lt; = RELEASEDATE the DatePart ( "w", PlacementDate) = 0 then the weekend 2 = 2 = weekend 2 + 1 Aelsai Dinankpart ( "W", placement date) = 2 then WeekendDays2 = WeekendDays2 + 1 elseif DatePart ( "w", PlacementDate) = 4 then WeekendDays2 = WeekendDays2 + 1 elseif DatePart ( "w", PlacementDate) = 6 then WeekendDays2 = WeekendDays2 +1 finally PlacementDate = PlacementDate + 1 leaves loop leaves = WeekendDays + WeekendDays2 = ModWeekdays (NotificationDate, OrderDate PlacementDate , RELEASEDATE) End Function  

After

I am confused with this recursive function that The point is really finished? It is within the following:

  leaves = ModWeekdays (NotificationDate, OrderDate PlacementDate, RELEASEDATE)  

I do not work outside of life What can I stop it from doing (I never doubt it) I think what is happening, you are constantly calling the function and eventually you are just running out of space, so your error .


Comments