excel - How to catch error "File not loaded completely" -
i have code opens text file. contains number of rows more limit of excel. when manually opening it, there prompt says "file not loaded completely" when in macro, don't see prompt.
what want catch error. when display alerts of macro enabled, still no error caught.
on error goto catch_err ...open text file here on error goto 0 catch_err: msgbox err.description
that structure of code.
why don't stream file in , move next tab every time hit 1m rows?
i threw you, excuse citrix line in there (i needed testing, left in in case on environment).
sub bigfile() dim myfile string, textline string, x long 'myfile = "\\client\c$\temp\yourbigfile.txt" 'silly citrix syntax myfile = "c:\temp\yourbigfile.txt" 'normal syntax open myfile input #1 until eof(1) x = x + 1 if x = 1000000 + 1 sheets.add x = 1 end if line input #1, textline range("a" & x).formula = textline loop close #1 end sub
this way don't need test error because there won't one.
Comments
Post a Comment