vba - Type mismatch error 13 arrays -


i have read through examples on stackoverflow , still can't seem statement right - can point me going wrong please?

the error type mismatch @ point trying split line of text held in linetext multidimensional array orders(). tried raworders(j) orders(y, x) same result.

dim raworders() string dim orders() string dim linetext string  dim h integer dim p integer dim x integer dim y integer dim j integer  dim filepath string dim filename string dim filenum integer  filenum = freefile() open filename input #filenum     raworders = split(input$(lof(filenum), #filenum), vbnewline) close #filenum  redim orders(3, 21)  h = 1 p = 0 j = 0 x = 0 y = 0  while not raworders(p) = ""      linetext = raworders(h)      while j <> 21          orders(y, x) = split(linetext, ",") *errors out here giving type missmatch*          x = x + 1         j = j + 1     loop      y = y + 1     h = h + 1     p = p + 1 loop 

dim splitres() variant 'one dimension dim orders()  splitres = yoursplitfunction redim orders(3, 21)  while j <> 21      orders(y, x) = splitres(j) 'guessing have 21 values in linetext                                'if have less error     x = x + 1     j = j + 1 loop 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -