VBA Excel Macro error: 1004 unable to get the substitute property of the WorkbooFunction class -


i using vba macro find big string in text file. read text file , read text compare (which saved in 1 of cell). after replace crlf cr (since saved text not contain crlf). compare. working fine if file size less. throwing error when file size high (around 50 kb fine). guess maximum size of file?

the below part of code throwing error

  open logfilepath input #ifile   strfilecontent = input(lof(ifile), ifile)   close #ifile   strfilecontent = application.worksheetfunction.substitute(strfilecontent, vbcrlf, "")   strsearch = application.worksheetfunction.substitute(strsearch, vblf, "")   strfilecontent = application.worksheetfunction.substitute(strfilecontent, vbtab, " ")      if instr(1, strfilecontent, strsearch, vbbinarycompare) > 0     searchtextfile = "success"   else     searchtextfile = "failed"   end if 

enter image description here

any guess or suggestion please.

i note error refers substitute property , using application.worksheetfunction.substitute.

personally, in vba tend use replace function works in same way.

i use when processing large .txt files (20,000 rows/30mb) , don't encounter problems it.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -