How to fix run time error '13' in Excel VBA? -


i have huge excel vba file (xlsm). used able run without problem. co-worker runs without problem. when run it, keeps giving me "run time error '13'". installed patch called: "excel2010-kb2956142-fullfile-x64-glb" on windows 7, 64bit machine.

here code snipet:

ipos2 = 0 on error resume next ipos2 = application.match(scomponent, sbslvlshort(), 0) on error goto 0 

the debug stops @ line with: application.match else can done? know excel has no problem.

thanks help.

jennifer

enter debug mode when code "breaks".

then, in vbe "immediate" pane, enter following statement , press return key:

?typename(ipos2) 

and tell me prints on next line. again in immediate pane, enter statement , press return key:

?application.match(scomponent, sbslvlshort(), 0) 

then, tell me printed on next line.

whatever being stored in array causing mismatch data type associated ipos2 variable.

one other possibility have inadvertently enabled option in vbe "break on errors". in vbe check tools | options | general , ensure "break on unhandled errors" option checked. otherwise, errors wrapped in on error resume next statement raise (the application.match function return error type if value isn't found in array).

otherwise in array? have verified using locals pane examine contents? (if don't know how this, google useful!)

if not containing expect contain, need work backwards , find line of code assigns variable, , debug there. @ point, seems user error (i.e., you've provided wrong inputs procedure, in case error expected).


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -