I'm getting a type mismatch can anyone please tell me how to fix it?

HuwGro

New member
Local time
Today, 17:53
Joined
Jun 7, 2019
Messages
3
Public Function TrimNull(startstr As String) As String
TrimNull = Left$(startstr, lstrlenW(StrPtr(startstr)))
End Function
 
What is the purpose of your function in simple plain English?
 
The ONLY place in that which you showed us is here:

TrimNull = Left$(startstr, lstrlenW(StrPtr(startstr)))

Based on the syntax of the LEFT$ function, the item in red MUST be a number. If that function returns anything OTHER than a number, that is your syntax error.
 
Left$(startstr, lstrlenW(StrPtr(startstr)))

Debug 101: Divide and conquer.

You've built a chain of functions. Make sure the smallest link works and then work backwards:

1. What's in startstr? Is it the item causing the issue?
2. Does StrPtr(startstr) return a value? Is it the item causing the issue?
3. Does IstrlenW(StrPtrstarstr) return a value? Is it the item causing the issue?
 
Debug 101: Divide and conquer.

You've built a chain of functions. Make sure the smallest link works and then work backwards:

1. What's in startstr? Is it the item causing the issue?
2. Does StrPtr(startstr) return a value? Is it the item causing the issue?
3. Does IstrlenW(StrPtrstarstr) return a value? Is it the item causing the issue?
I'm not sure the person would know how to do that plog. Not judging, just saying...

It takes a lot of knowledge to know how to do something like that, even if it is not really that advanced.
 
I'm not sure the person would know how to do that plog. Not judging, just saying...

It takes a lot of knowledge to know how to do something like that, even if it is not really that advanced.
I think you will find that your first statement is Judging.

It certainly doesn't take a lot of knowledge, just some steps as @plog accurately described.
As usual, your post is unhelpful and brings nothing to the table to assist the OP.

Welcome to my ignore list.
 

Users who are viewing this thread

Back
Top Bottom