00:03
5 hours later…
7 hours later…
12:03
Hello, I was wondering why sometimes in VBA I cant press Run to test out my code. I'm not sure how to simulate it, so I hope somebody just recognizes what I mean. It seems like Visual Basic gets in some sort of state where it looks like it is done running all the code, but it isnt. In order for it to run again, at least its what I do, I press the Reset or Pause button and or via menu Debug -> Compile VBAProject. Its something with code debugging/code cancelling..
Does this ring a bell with anybody? I would like to pinpoint what this behaviour is exactly. If nobody does I'll figure out a routine where this happens
4 hours later…
15:59
@jonadv This sometimes happens when I think something has finished but it hasn't. Maybe there's a userform up somewhere but hidden. Generally I just mash the square stop button and it's all fine, never have to recompile. Also state can persist in module scoped variables, so you run a Sub and it exits but there are still some event listeners in a collection declared in outside the sub (although these won't stop you being able to run things).
Like if you want to set up an event listener for Worksheet_Change events, the VBA isn't constantly running but you still have objects floating around in memory. VBA is built on COM which means objects manage their own lifetimes by counting things which reference them, so it's totally fine for them to stick around after the code "ends normally" if that makes sense? Sorry not sure this is what you're getting at.
3 hours later…
18:54
"VBA is built on COM which means objects manage their own lifetimes by counting things which reference them, so it's totally fine for them to stick around after the code "ends normally" "
Thanks, this makes perfect sense. Even though I dont use UserForms or Worksheet_Change events, over time probably snuck into my code library (just 1 .xlam file) which causes this
I have VBA developer (github.com/hilkoc/vbaDeveloper) installed since a few months and that has some workbook_[events], might be a cause. I tried RD for a bit, but couldnt find any big advantage for the work Im doing in vba
5 hours later…
23:48
« first day (2619 days earlier) ← previous day next day → last day (561 days later) »
Transcript for
Aug6
Aug '217
Aug8
VBA Rubberducking
This chat has moved to Discord: discord.gg/MYX9RECenJ