Resolved making a public sub

andrews

Well-known member
Joined
Nov 22, 2011
Messages
167
Programming Experience
5-10
I code a sub in a module : public sub readgrid ..... and so on
There is an error : the first character must be an upper case
???
When I change the name in Readgrid and I want to play the sub then there is a new error : Declaration expected
What is going on?
Thanks for any response
 
Is this issue really resolved? If so, please post your solution, so that it might help others. If not, why did you mark it Resolved? If you still need help, please provide a FULL and CLEAR explanation of the problem. If you want help with code that is not working, it should be obvious that you need to provide that code, although please remove anything that is not relevant to the issue.
 
Perhaps you should provide a FULL and CLEAR explanation of your problem and your solution. If you don't understand why it worked, there may be a better way. Regardless, we cam explain the problem and the solution to you and you'll learn something that may help you in future.
 
I will try to show what I could not understand
1) When coding a new sub (pubic sub name ....) in a module an error message appeared: the first character of the name must be a capital letter
2) When that was apparently solved and I called this sub in another sub in the same module an error message appeared: the sub is not defined
 
1) When coding a new sub (pubic sub name ....) in a module an error message appeared: the first character of the name must be a capital letter

VB has no such requirement so that was not a compilation error. VB requires that identifiers begin with a letter or an underscore, with no rules regarding the casing of that letter. Of course, methods should ALWAYS start with an upper-case letter by convention, so this should never be an issue in the first place. What you saw was a message from a code analyser that is configured to enforce such conventions. Just do the right thing in the first place. Maybe you could show us the actual code instead of some vague approximation that doesn't actually demonstrate what you did and what happened when you did it. I didn't emphasise "FULL and CLEAR" twice in my previous posts for nothing.
 
2) When that was apparently solved and I called this sub in another sub in the same module an error message appeared: the sub is not defined

Again, your vague description doesn't help. Show us what you actually did and what actually happened.
 
Dear moderator, sorry, there are no more errors after correction but I don't remember where the code was wrong.
Anyway, many thanks for your advices, regards
 
Back
Top