May 30 2022 04:21 AM
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?
May 30 2022 04:32 AM
Can you click Debug in the error message and find out which line causes the problem?
Jun 01 2022 02:19 AM
Jun 01 2022 02:23 AM
SolutionSee 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)?
Jun 01 2022 02:25 AM
Jun 01 2022 02:39 AM
@Excelworksprograms Val always returns a numeric value, but it may not be what you wanted. You may have to use
Wsabc.Cells(1,2).Value = Val(Replace(txtabc.Text, ",", "."))
Jun 01 2022 02:43 AM
Jun 01 2022 02:44 AM
A / as decimal separator? I've never seen that. Or are they entering a date?
Jun 01 2022 02:47 AM
Jun 01 2022 02:49 AM
See how it works, it's best to test with various settings.