I have been trying to sort this error and can't understand why it is happening. tried changing name of the sub and check many times to make sure the spelling is exactly the same but the error keeps ocurring and i can't understand why. Can someone help?
1 Answer
You should not use the same name the module and the procedure. This will cause a conflict.
So if you Call SortDataSource it will find the module name first and of course it cannot call a module (only a procedure or function within a module).
So if you use the same names you need to Call SortDataSource.SortDataSource to make it call the procedure SortDataSource inside the module SortDataSource:
Syntax is like
Call ModuleName.MethodName(Argument1, Argment2)
or without Call which is not needed.
ModuleName.MethodName Argument1, Argment2
But I highly recommend not to use the same name for a module and a procedure. As you can see it can cause errors that can easily be avoided by choosing different names.
7 Comments
ModuleName.MethodName Argument1, Argument2 give an error? shouldn't it be ModuleName.MethodName(Argument1, Argument2) Not tryna be rude or anything. was just wondering :)Call then the brackets are required.
ModuleName.MethodName