How could you possibly de-reference
RefDesgStr
if you explicitly initialized it as
Nothing
? This is all the problem. Instead, you could do something like:
Dim RefDesgStr As String() = New String(SubTables.Count) {}
You consideration of "overridden in each loop" is totally wrong. You are working with the array of string type. When you assign a string value it its element, the element can be null, but not the whole object. If you are not getting it, I'm afraid you would rather learn language and programming nearly from the very beginning, to understand what is the type, reference or value type, reference, instance (object), array, array element and related very basic concepts.
Next time, always run your code under debugger and examine variables before the exception is thrown. This type of bug is one of the easiest to fix.
—SA