• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 53
  • Last Modified:

ByRef type mismatch when invoking a sy+ub

I am getting a "By Ref argument type mismatch" which I can't understand

The error is below:

but the argument looks correct (it is declared)

and the sub is defined:

can anyone help?
João serras-pereira
João serras-pereira
1 Solution
Martin LissOlder than dirtCommented:
The sub expects an Integer but you are passing a double. Change either one so that they match.
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
In your dim statement you cannot follow each with a comma and then put the last serval “as <type>“

So right now only the last variable in your dim statement is a double. All the rest of them are variants.

You need to use “as <type>” for each

João serras-pereiraAuthor Commented:
Hi THANKS!!!! did not know that!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now