
This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This article contains sample Microsoft Visual Basic for Applications procedures that you can use to work with several types of arrays. I've observed the text file in a hex editor, and there are no unprintable characters in the file (no ASCII NUL bytes, etc).For a Microsoft Excel 2000 version of this article, see 213798.įor a Microsoft Excel 98 and earlier versions of Excel version of this article, see 149689. The array is populated by reading from a text file generated by the CMS operating system. Given that the max indices are 37 for the first dimension and 1 for the second, why does (3, 0) cause a type mismatch in VBScript but not in VB6 for the same array? The Event Viewer under Windows Logs/Application does not have any message for this issue. But in VBScript on that same array when I do msgbox packageDetails(3, 0) an exception is thrown with the description, "Type mismatch: 'packageDetails'". In VB6 packageDetails(3, 0) stores the string "EA", this is the expected value.


9,999 records work without error, but in ONE of the records I have the following issue: For each record I parse the data from the TXT file, populate array "packageDetails", then pass it to my DLL. I have a CMS-generated TXT file with 10,000 records.

In both VB6 and the VBScript I observe the following: msgbox isArray(packageDetails) ' True

In VBScript and VB6 it is declared as: dim packageDetails In the VB6 program and in the VBScript the array variable is named "packageDetails". It sounds convoluted and antiquated, I agree, but my job is to fix the bug not re-write a lot of code. I have a VB6 program which populates a two-dimensional array, passes that array into a function of a COM DLL, and then the COM DLL executes a VBScript assigning the array to a variable within the VBScript.
