+ Reply to Thread
Results 1 to 7 of 7

run-time error '13' type mismatch

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Chandler, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    run-time error '13' type mismatch

    Hello I am new to VBA programming. I get run-time error '13' type mismatch in my VBA macro. My code is below. now the funny thing is if I delete "StartInsTime" my code runs, but if I include it i get the runtime error. Any clues on how to resolve this? I am thinking it is a character length issue but I am not sure. Let me knwo. Thanks!



    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: run-time error '13' type mismatch

    the elements of the array can only have 255 characters. you don't need the array at all-just build the sql string up as one string and pass that.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    Chandler, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: run-time error '13' type mismatch

    Quote Originally Posted by JosephP View Post
    the elements of the array can only have 255 characters. you don't need the array at all-just build the sql string up as one string and pass that.
    thanks joseph.could u expand on your answer a little? when u say i dont need the array, what should i use instead? sorry for my ignorance!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: run-time error '13' type mismatch

    Please Login or Register  to view this content.
    basically. note there's not much point to an IN clause with only one item-you can just use = '8135' instead

  5. #5
    Registered User
    Join Date
    08-30-2012
    Location
    Chandler, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: run-time error '13' type mismatch

    wow. that easy huh! I will give a try this weekend and let you know how it went. Thanks for your input!

  6. #6
    Registered User
    Join Date
    08-30-2012
    Location
    Chandler, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: run-time error '13' type mismatch

    Hey Joseph, finally got to try the code and it worked like a charm! thanks for your help buddy!

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: run-time error '13' type mismatch

    you're welcome :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1