I attempting to use vba to import 2 different CSV files. The files are almost identical so I am trying to reuse as much of the code as possible by using variables in the settings. The setting that seems to be causing me problems is the
.TextFileColunmDataTypes = Array(DataArray) where I defined the variable DataArray as String and the value is set based on file type as follows.
DataArray = "2, 2, 9, 9, 9, 2, 2, 9, 9, 1, 9, 2, 2, 2"
In testing I receive an error of
Run-time error '5':
Invalid precedure call or argument
.TextFileColunmDataTypes = Array(DataArray) where I defined the variable DataArray as String and the value is set based on file type as follows.
DataArray = "2, 2, 9, 9, 9, 2, 2, 9, 9, 1, 9, 2, 2, 2"
In testing I receive an error of
Run-time error '5':
Invalid precedure call or argument