# Visual Basic > Office Development >  [RESOLVED] Program work fine when stepping through, but hangs otherwise

## groston

I have written a fairly simple VBA program for Excel. When I step through the code, in the debugger, it works just fine and does what it is supposed to do. However, if I remove the breakpoints and just tell the function to run, it hangs. When I look at the task manager, Excel is using 13% of the CPU and the function never returns.

The only 'unusual' thing the function is doing is calling a Print command. Other than that, it is doing simple string manipulation on data that has been read into the function. What can I try to resolve this? I have attached the file in case anyone wants to look...

----------


## groston

When I got away from the computer and thought about this, I realized that there is a logic bug in the code and the program is, properly, infinite looping...

----------

