last day (15 days later) » 

7:08 PM
1
A: Removing a number sequence from product name?

IboThis is rather advanced, but it is more powerful to use Regular expressions. Define your range that you want to remove the numbers. It could be one cell or numerous cells=range at once. You need to define your range in sub Main and it will take care of that. As an example, I used range("A1:A3"). ...

 
Call keyword is obsolete, has been for at least 20 years.
 
Ibo
I know it would work without that too, but it is just how I learned and the minimum I can tell is that I have encountered cases that the sub did not work without call. Plus, call for me shows that the sub is a sub and not a function and it is a user-defined method. There are some other uses such as calling a class once which call will be useful to do that on one line or when converting to VB.NET etc it will help the conversion
 
I'd love to see that sub that didn't work well without Call - the single use-case I know that "justifies" a Call keyword involves instructions separators : that shouldn't even be there in the first place, making the first (parameterless) method call be interpreted as a line label. FWIW writing proper OOP code will go a much longer way towards facilitating .NET conversion than using keywords deprecated 3 versions prior to VBA7.
 
Ibo
well, I am not going to break my head to find the case that did not work properly without the call keyword, but search on SO and you will see how people mention examples that using call is useful.
 
This is the case you're looking for.
 
Ibo
7:08 PM
I agree with you. I never liked : separation, but there are more cases. One case if that when you call a function that has some optional arguments most likely it will not work in the Immediate window unless you provide the optional arguments, but if you use the call keyword, it will work. Also check this and this
 
Hehe.. the first link is the one I just provided, and the 2nd is VB.NET documentation, showing a syntax that VBA won't compile ;-)
optional arguments absolutely work in the immediate pane, as do named arguments
FWIW I've upvoted your answer - I'm just adamant about Call being useless in VBA =)
 
Ibo
Hi man, I have really like 5 minutes, I gotta go to a meeting soon
 
I've even put a static code analysis inspection in Rubberduck for it: rubberduckvba.com/Inspections/Details/…
no probs
 
Ibo
Call is not necessary almost in all of the cases, but there are cases that it does not really work well without it. I have encountered cases, but I cannot reproduce it for you since it was in some old projects
 
if you ever encounter them again, I'd really appreciate if you could create an issue on github.com/rubberduck-vba/Rubberduck
I'd tweak the inspection to recognize and ignore that specific case
(I hate inspection false positives, and/or quick-fixes that actually break the user's code!)
cheers!
(and happy hat-hunting season!)
 
Ibo
7:14 PM
yes, you tweak something and it will work, that is what we do too, but in the end if you checked the link I sent you in the remarks it says: For most procedure calls, you aren’t required to use this keyword.
for most procedure calls, and not for ALL
do you use rubberduck? is it good? does it cause problems?
 
@Ibo I own & manage Rubberduck :)
(so my view on it is probably slightly biased)
 
Ibo
LOL
 
there are a number of issues though
mostly involving proper shutdown
 
Ibo
I am maintaining a big VBA application and I cannot afford issues of integrity etc since my users are nearly 70+ and increasing
I have always used the original VBA and I know it sucks and microsoft does not care about it anymore
 
FWIW I'm not having any showstopper issues in Excel
but I've been using it quite much recently and noticed a number of annoying false positives with a number of inspections
not a showstopper though
 
Ibo
7:20 PM
I will give it a try
 
my next feature will be an add/remove references dialog that isn't a royal PITA to use :)
other contributors are working on other features too
one is gettting the Extract Method refactoring back on track
@Ibo the Code Explorer alone is worth it if your project is any decent size :)
 
Ibo
I just installed it, but I cannot find it
 
got admin privs?
 
Ibo
yeah
 
cannot find it... as in, it's not starting?
it only starts when the VBE launches
 
Ibo
7:24 PM
There is onlt RD on the web and uninstall
should I restart?
 
fire up Excel
 
Ibo
oh
 
it's a VBIDE add-in
like MZ-Tools, or Smart Indenter
actually Smart Indenter gave us their source code; we ported it to C#, fixed a couple of edge-case bugs, and now Rubberduck's indenter is Smart Indenter =)
 
Ibo
maybe you should think of a way to start VBE through it
 
we don't own the process that loads us (EXCEL.EXE)
 
Ibo
7:27 PM
is it only one toolbar?
Parse Error?
 
user2509848
Ouch.
 
oh really
 
user2509848
Grammar broken.
 
come on
 
Ibo
Thats the only thing I see
 
7:28 PM
does the code compile?
(that's the one assumption we need to make)
 
Ibo
which code?
 
the VBA project that's loaded
there's no code?
 
Ibo
yeah, everything looks fine
 
wow, so much for a first impression lol
 
Ibo
hang on, there is a RD menu
 
7:30 PM
is that version 2.1.1.2532?
 
Ibo
2567
2.1.2.2567
I am on Win 7
Excel 2010
 
FYI you could bring up the about box and click the version number to copy all that info to the clipboard :)
I think the guys broke something involving the parser over the weekend, better stick to "green" releases for now
(we're trying to upgrade to Antlr4.6, and it's not quite cooperating)
 
Ibo
what is the best feature of it?
 
I'd say the Code Explorer (@Hosch250 worked hard on that one!) works like a charm (when the parser does)
custom folders, member-level drilldown, show/hide signatures, custom sorting
oh and that nifty search bar at the top
when Rubberduck renames something, all references to that name are automatically updated
 
user2509848
Yeah, that one's my baby, even if Mat did the UI.
 
user2509848
7:36 PM
I just did the logic (which is both easier and harder :P)
 
Ibo
It does not bring anything on my computer
 
user2509848
FWIW, the refactorings are my favorite feature.
 
Ibo
How can I add a snapshot here
 
and [refresh] just says "parser error"?
 
Ibo
I tried refresg
nothing happened
parser error shows me one error
MMR_CLICK Module L245C28 extraneous input 'Integer' expecting {':=', WS, LINE_CONTINUATION}
 
7:39 PM
where does double-clicking take you?
is there a token that's split across 2 lines?
could be a legit grammar bug
 
Ibo
it takes me to a sub called CountInvalidDescriptions
inside MMR_CLICK module
 
user2509848
Can you post your code here?
 
user2509848
Or an MVCE?
 
those damned line continuations...
 
Ibo
7:41 PM
'=========================================
' Check Only Descriptins Invalid Function
'=========================================
' Gets the tblMaster and checks whether there are ONLY comments in the column of descriptions and NOT MATNRs after SAP Validation
' This function will allow users to continue to assign an MMR # when SAP Validation result is FALSE due to invalid descriptions
' in a MODIFY BASIC request. The conditions happens when the users want to modify the descriptions of the materials.
 
I bet it's these two:
dimiCountDescYellow As Integer 'count of the description that DO NOT exist in the system
dimiCountDescOrange As Integer 'count of the description that DO exist in the system, but are NOT HHI
 
user2509848
Reproduced it.
 
(assuming that was pasted straight from the editor)
 
user2509848
And fixed it.
 
user2509848
Yep, @Mat'sMug.
 
user2509848
7:43 PM
Wait a sec.
 
hmm, how does that compile?
 
user2509848
It doesn't.
 
Ibo
guys this function works fine and it has been working fine for a very long time
it is a production version
 
without a space between dim and iCountDescYellow?
 
Ibo
I need to run, meeting, you can update me per email
 
7:45 PM
Alt+D, ENTER
@Ibo I'll just leave this browser tab open
so yeah, in the current version RD requires the code to be fully compilable, because a parser error means we don't know what we're looking at, so we bail out. once we have our own code panes, we'll change that and turn them into red squiggles
 
7:58 PM
@Mat'sMug It wasn't me this time?
 
lol, I don't think it was :)
I just need @Ibo to confirm Alt+D,ENTER effectively craps out on the same lines RD is complaining about :)
 

last day (15 days later) »