- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I have a bit of a silly question as i don't have a strong background in programming.
I try to loop through center marks to add breaks withing a drawing.
I call a different sub with 2 centermarks as references.
But my loop stops after placing 1 break (when i do not display a messagebox).
But when I do display a messagebox for each time it loops, it loops just fine to the end.
I have tried for and while loops but get the same result.
How Could i resolve this so i don't get 50 message boxes when i try to get to the end of my loop.
And what could cause this behaviour for future reference ?
TL:DR how can I make my loop go to the end without the need of interaction through a messagebox.
For BreakCount As Integer = 0 To cmCollection.Count -2 Step 1
MsgBox(BreakCount) 'without this the loop ends after 1 break
BreakBetweenCentermarks(ThisDoc.Document.ActiveSheet.DrawingViews(1), cmCollection.Item(BreakCount), cmCollection.Item(BreakCount + 1))
Next BreakCount
Many thanks in advance
Solved! Go to Solution.