1

I found a problem with the VBA Locals Window while debuggin a macro in Excel 2013. I used the Locals Window to track the value of a string.

If the string exceed a certain length (about 100 caracters) it is not possible to copy it out of the Locals Window to examine it somewhere else (eg. in notepad++).

Is there a way to access the full content of a string variable at runtime ?

Lorenz Meyer
  • 18,330
  • 22
  • 72
  • 114

1 Answers1

1

One option is to copy the string to the clipboard (from code itself or, when the code is paused, from the Immediate Window).

Then again, this is not that easy in VBA, but you can go two ways, as described
on SO HERE.
The solution with API-calls and a ready-made function from the msdn post (also mentioned in that answer) is a bit lengthy, but then again it just needs copying once into a module and then works fine straight away. I just tested it with 100K characters - no problem.

Community
  • 1
  • 1
KekuSemau
  • 6,765
  • 4
  • 24
  • 34