VBA Error "Type Mismatch"

S

steve

I have a piece code containing a variable

Dim CopyFullName as Variant

The purpose of the variable is to generate a full file name from a
variety of sources - most of which are string based but some times the
string is converted from another source hence the data type variant.
These are concatenated together to generate the final variable.

After several 10s of thousands of iterations the programme declared a
run time error of "Type Mismatch" for a particular string (and no other
- so far). More over this is a batch process - all the other variables
in the same batch were created through the identical pathway and did
not generate the run time error.

Any thoughts on how or why vba should generate a type mis-match for a
particular string where the data type declaration is variant?


Stephen Allen
ACBA
 
G

Guest

Any possibility you were harvesting an error value off a spreadsheet and
expecting a string?
 
S

steve

Tom

I was indeed harvesting some of the info from a spreadsheet, but there
are no signs of error values on the spreadsheet itself.

One unusual event occurred. I made a mistake on the spreadsheet and
instead of cutting and pasting in standard fashion I moved the cell
values using the cursor. Could this have generated a behind the scenes
error?


Stephen Allen
ACBA
 
T

Tom Ogilvy

Cutting can cause formulas to produce an error(s) - if that is what you are
asking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top