Declare all variables with proper types, do not leave them undeclared. Leaving them undeclared flags VB to declare all undeclared vars as variants, killing your memory and slowing down the code execution. This might be the source of your problem also. if OBUF is an array of integers, you will not be able to set an element of this array to "**" since ** is a string value. Once your types are fixed, just use OBUF(1) = "**" etc.

P.S. To enable "undeclared variable check" in VB click on Tools > Options and under Editor tab check Require Variable Declaration. Doing so will automatically add option explicit to the top of every form/module, etc created so all undeclared vars will throw an error upon compilation.