Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Error "Type Mismatch"

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default VBA Error "Type Mismatch"

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

--
Regards,
Tom Ogilvy


" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Error "Type Mismatch"

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


Tom Ogilvy wrote:
Any possibility you were harvesting an error value off a spreadsheet and
expecting a string?

--
Regards,
Tom Ogilvy


" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA Error "Type Mismatch"

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

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
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


Tom Ogilvy wrote:
Any possibility you were harvesting an error value off a spreadsheet and
expecting a string?

--
Regards,
Tom Ogilvy


" wrote:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reasons for "Run-time error '13':Type mismatch"? BagaAzul Excel Programming 2 March 20th 06 11:08 AM
Error Handling to mitigate "Run Time Erorr 13 Type Mismatch" ExcelMonkey Excel Programming 3 October 16th 05 01:56 PM
"FIND" generates "Type mismatch" error quartz[_2_] Excel Programming 5 November 16th 04 03:29 PM
Copying data to another worksheet gives "Type Mismatch" error TB[_3_] Excel Programming 6 July 28th 03 12:44 PM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"