Also try Application.CutCopyMode = False
User 2558377
Posts
-
Not so much bad code as kludge -
Redundancy PeakingI don't see why this is specifically a problem with VB - exactly equivalent code can be and often is written in C# and other languages.
Anyway, to be really sure the control is visible you should obviously write
If (myControl.Visible = True) = True Then...
so it doesn't effect performance
You mean "affect" (I hope) -
Ambiguous error messages...What gets me is any error message with an exclamation mark at the end. "Date format is invalid!", "An unknown error has occurred!". Whenever I get one I automatically imagine the words "you idiot" added to the end. An equally annoying variant is a success message with an exclamation mark: e.g. testing an ODBC data sources gives "TESTS COMPLETED SUCCESSFULLY!" - what, so that's such a big surprise that you have to shout at me?
-
Professional conditions with IFThis kind of thing is standard shortcut syntax in COBOL (or was when I last used COBOL many years ago): IF X = 1 OR 2 THEN... is the same as IF X = 1 OR X = 2 THEN... The big gotcha comes when you add a NOT into the mix. All new COBOL programmers would at some point write a statement like: IF X NOT = 1 OR 2 THEN.. which unfortunately expands to IF X NOT = 1 OR X NOT = 2 THEN.. so the condition is always satisfied. Some of those beginners learn from the experience and don't make the mistake again. Others, however....