Forum Discussion

Excelworksprograms's avatar
Excelworksprograms
Copper Contributor
May 30, 2022
Solved

Type missmatch

Hi ive run into trouble in a weired situation of type mismatch error

There are two computers installed the same version and build and both 64 bit

When the vba code runs in the first it doesnt return any error but the same cone runs in thd other and returns type mismatch error what could ther root cause of thus problem be?

  • HansVogelaar's avatar
    HansVogelaar
    Jun 01, 2022

    Excelworksprograms 

    See if it works if you use

     

    Wsabc.Cells(1,2).Value = Val(txtabc.Text)

     

    If not: do the users where it fails use a different decimal separator than you (point vs comma)?

    • Excelworksprograms's avatar
      Excelworksprograms
      Copper Contributor
      I just found that a cells value is like this
      Wsabc.cells(1,2).value=cdbl(txtabc) in which txtabc is on a user form the code runs by clicking a command button on the form
      The problem is this code runs on my computer and some other but it gets to a type mismatch on another computer with same version and build of excel
      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Excelworksprograms 

        See if it works if you use

         

        Wsabc.Cells(1,2).Value = Val(txtabc.Text)

         

        If not: do the users where it fails use a different decimal separator than you (point vs comma)?

Resources