« first day (824 days earlier)      last day (2356 days later) » 
00:00 - 20:0020:00 - 00:00

12:01 AM
RELOAD!
[Hosch250/Battleships] 1 commit. 2 additions. 2 deletions.
[Phrancis/StackExchangeDataToMicrosoftSQLServer] 6 commits. 322 additions. 136 deletions.
[rubberduck-vba/Rubberduck] 5 opened issues. 2 closed issues. 32 issue comments.
 
12:22 AM
> Might be I'm blind, but I don't see the problem with the snippet there. Did you mean to make a Property Let accessor call? Please clarify what we're looking for here.
> Oh duh
> Nevermind
 
12:47 AM
I recently saw somebody advocating for using VBA as a wrapper for running javascript and Python scripts.
I suspect a Python programmer wrote a script to generate all the votes for that suggestion
And somewhere inside MS, they still have the code for VSA.
 
I didn't see the down-vote button.
 
crowd-sourcing only works if the down-voters are allowed to participate.
 
LOL
Python#?
 
Syntax Correction: ?TypeName(Python) = "Double"
 
On the other hand, MS claims that Office is installed on 1.1 billion PCs, so they do already have the support of .0000072% of the installed user base.
 
WTH? I can give from 1 to 3 votes?
 
yes, but you have a limited number available
 
In that case I'll have to revise my estimate down to .000002407% of the installed user base.
Or, assuming the (IMHO less likely) average case, 0.000003611%
I personally think that anyone who expects it to be anything other than .NET is deluding themself.
 
1:28 AM
wow - I posted that suggestion at 11:01, and there's a commented on it within 2 minutes... undoubtedly a script kiddie...
 
1:42 AM
@ThunderFrame have some German sass on your side :)
 
Jawohl
 
2:04 AM
> I have just checked this against next and This didn't show up for me. Additionally the Code Quality Issues Inspections include "Object variable assignment requires 'Set' keyword" on my end, which don't show up here. Then again the order seems kind of messed up, because the other items don't show in that order for me ...
> The missing caption is "Public field breaks encapsulation", and the blank tooltip should be:

> **Public field breaks encapsulation**
> Consider exposing a property instead.

@Vogel612 indeed, the sorting order appears to be different - I believe there is no sorting defined, the order they show up is determined by the order the types are reflected from the compiled assembly by the .net runtime... which is another issue, pointed out in #2193.

This one seems fixed to be now though.
 
@Vogel612 removed "no repro" - I'm pretty sure the screenshot wasn't forged ;-)
oddly I can't seem to locate at which point the missing caption was added
 
@Mat'sMug hmm... okay so [norepro] <> [tentatively-fixed]
 
could also be a missing translation.. hold on...
 
or to be more semantically correct [norepro] \nsupseteq [tentatively-fixed]
it's english UI, so no translation missing
 
meh, there's a French translation for it
and I haven't translated anything in French since... since...
 
2:15 AM
German also has all showing up
 
we need more languages
 
nothing I can really do about that ....
while we're at i18n ... the RegexAssistant currently is english-only
 
hmm
it'd be nice to have that "expression builder" tab for next release =)
(I don't know when the next release is going to be)
@Vogel612 i18n?
 
@Mat'sMug Right now I'm actually thinking of overhauling the design a bit and moving Quantifiers from IRegularExpressions to Atoms
@Mat'sMug internationali(z/s)ation. count the letters between i and n
 
LOL
 
2:19 AM
This could make the expression builder much easier, because at that point you can drag & drop tree nodes into the expression tree and generate your Regex out of that
 
Ooh shiny!
 
then again you could probably do that right now anyways
and I still didn't get a really in-depth answer on the question :/
 
Hmm did I answer that one?
 
nope. Heslacher has a +2 answer
and that's it
 
link?
nvm
 
2:32 AM
@Vogel612 I had seen the question, but not Heslacher's answer
 
I think it's a good answer, just not the one the question could have gotten with a bit of a look into the design
okay adapting the tests was a minor hassle, but hey ... it works just fine
moved the Quantifier from IRegularExpression into Atom, and we're still all green
now let's see whether it actually still works ...
 
there's no way to ensure matching parentheses in the ANTLR grammar is there?
 
If I remember correctly (big if) matching parens are a Type-2 language... so there should be
 
argList : LPAREN (whiteSpace? arg (whiteSpace? COMMA whiteSpace? (byvalArg | arg))*)? whiteSpace? RPAREN;

arg : (OPTIONAL whiteSpace)? ((BYVAL | BYREF) whiteSpace)? (PARAMARRAY whiteSpace)? unrestrictedIdentifier (whiteSpace? LPAREN whiteSpace? RPAREN)? (whiteSpace? asTypeClause)? (whiteSpace? argDefaultValue)?;
byvalArg : LPAREN+ unrestrictedIdentifier RPAREN+;
hmm that needs some fine-tuning
 
recursions allowed or not?
 
2:44 AM
it's allowed
 
byValArg : LPAREN byValArg RPAREN | LPAREN unrestrictedIdentifier RPAREN
 
huh, that's genius
 
yea but it doesn't work for all combinations of matching parens. that's a story for another day though
 
DoSomething ((((foo)), (bar)))
whatever
 
wait that's legal??
 
2:48 AM
no
DoSomething ((((foo)))), ((bar))
is though
 
ah right... no tuples
 
huh, the VBE just keeps crashing on me now
wtf
 
it's 5 AM and I'm writing a selfie ... whelp
 
lol
well I can't seem to be able to even launch a RD build
@Vogel612 you might consider getting some sleep ;-)
 
I strongly am.
selfie finished. Heslacher got the big basic stuff out of the way, I took a shot at design and two small itches that kept annoying me
imma just quickly apply some of the ideas in that answer
 
3:06 AM
nice observations there
 
Hmm, Join$ and Atn# are valid functions.
Stupid typedefs
 
oh crap. it's argumentList, not argList
hey @ThunderFrame
argList is for the declarations, not the call sites
 
> partially incorporated changes suggested in reviews, fixed prior design mistake
[rubberduck-vba/Rubberduck] Vogel612 assigned Vogel612 to pull request [#2223: RegEx Assistant "tuneups" [WIP]](github.com/rubberduck-vba/Rubberduck/pull/2223)
 
such square brackets, much how
 
please don't merge that one yet.
I'll go over the suggestions for properties and Regex construction.
and I'll add basic validation...
 
3:17 AM
[rubberduck-vba/Rubberduck] build for commit e77d5c40 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
but that's for tomorrow, because I actually need to think there
 
Assert.AreEqual failed. Expected:<Rubberduck.RegexAssistant.SingleAtomExpression>. Actual:<Rubberduck.RegexAssistant.SingleAtomExpression>.
do you override ToString in SingleAtomExpression?
Assert.AreEqual failed. Expected:<1>. Actual:<2147483647>.
hmm
@Vogel612 sleep. you actually need to sleep lol
 
@ThunderFrame WTH? I wonder why?
x = Split("foo,bar", ",")
Debug.Print TypeName(Join(x, vbNullString)) = TypeName(Join$(x, vbNullString))
'^^^True
 
[rubberduck-vba/Rubberduck] Vogel612 synchronized pull request [#2223: RegEx Assistant "tuneups" [WIP]](github.com/rubberduck-vba/Rubberduck/pull/2223)
 
@Mat'sMug I'm just fine. Should've run the tests before pushing though.
 
3:21 AM
Debug.Print TypeName(Atn(180)) = TypeName(Atn#(180)) 'True
 
one was an overzealous change to the unit-tests' assertions when moving Quantifier around, one was an almost typo
 
[rubberduck-vba/Rubberduck] build for commit 1484e7cb on unknown branch: AppVeyor build succeeded
 
@Mat'sMug I didn't override ToString anywhere. Haskell kinda made me lazy with it working just fine when you say deriving (Show) ... not that I'm doing much haskell
anyways. hitting the feathers
or to keep your rusty German in shape: "Ich hau mich aufs Ohr"
 
@Comintern and yet CDbl# gets autocorrected in code module. Although CDbl#(5) appears to work in Immediate window.
 
....is there a... C# function?
 
3:28 AM
Debug.Print c# 'Prints 0
 
Lol
C# = F#
 
LOL
Debug.Print c# = True 'Prints False
Although... ?IsEmpty(c#) 'False
 
fingers crossed:
argumentExpression :
    (BYVAL whiteSpace)? expression
	| (LPAREN byvalExpression RPAREN | LPAREN argumentExpression RPAREN)                            # byvalExpression
    | addressOfExpression
    // Special case for redim statements. The resolver doesn't have to deal with this because it is "picked apart" in the redim statement.
    | lowerBoundArgumentExpression whiteSpace TO whiteSpace upperBoundArgumentExpression
;
 
3:43 AM
> The *Hotkeys* grid expands horizontally when the settings dialog is resized, but not vertically:

![image](https://cloud.githubusercontent.com/assets/5751684/18298992/10a72cfc-748b-11e6-808e-9470029408f8.png)

The grid maintains its height, and it doesn't feel right.
> The grid in the *Todo Settings* tab seems to resize correctly, but if the list contains more items than can fit in the height of the dialog, there's no scrollbar to access the overflowing ones:

![image](https://cloud.githubusercontent.com/assets/5751684/18299085/fac596b6-748b-11e6-91e7-d603ed04e932.png)
> ![image](https://cloud.githubusercontent.com/assets/5751684/18299184/c6d522e4-748c-11e6-9c2a-a1eaa4f4e0ca.png)

the label updates after the *refresh* button is clicked though:

![image](https://cloud.githubusercontent.com/assets/5751684/18299196/df9c5d88-748c-11e6-82ad-e406992ee9fd.png)

...but *only* after the *refresh* button is clicked.

![image](https://cloud.githubusercontent.com/assets/5751684/18299206/f767166a-748c-11e6-9762-aa5578bb9b7a.png)
 
4:55 AM
1
Q: Hex encoding and decoding of ASCII strings in VBA

ThunderFrameI needed to convert some Ascii text to binary in Hex format 0x00FF.... I've written an EncodeHex and a DecodeHex function to do the conversion. I've avoided using concatenation in favour of performance. I'm assuming that assigning the results of CByte("&h80") to a byte array, and then using St...

 
[retailcoder/Rubberduck] retailcoder pushed commit 86bae0a0 to next: swallow InvalidComObjectException when ParentMenuItemBase.RemoveChildren() somehow gets called at startup
 
I think I just might have reverted an hour of work headscratching because I was too dumb to clean/rebuild. TTGTB.
 
 
1 hour later…
6:25 AM
Fabio Marreco, Rio de Janeiro - State of Rio de Janeiro, Brazil
774 8 13
^ nice avatar
 
 
3 hours later…
9:39 AM
 
 
4 hours later…
1:49 PM
Dear Mat's Mug, thank you for your detailed answer, you made me learning a huge amount of new vba features, and programming in general :) Unfortunatly, however, the code doesn't run because of this error : "user-defined type not defined", that is apparently related to this Public Sub AddValidationRule(ByVal rule As IRangeValidationRule) rules.Add rule End Sub....any idea? — Lollo 1 hour ago
I've failed somewhere
 
Hello! I've been developing a dll with .net and I am succesfully using it on excel VBA. But I still need each user to add the TLB manually to use the class. Is there anyway to have a .bat do this automatically?
Or with vba code would be fine too.
 
hi!
AFAIK the .tlb needs to be registered locally on each user's machine
 
It's probably a registry entry right?
Maybe I could add it with powershell.
 
indeed, it's a registry thing. .net itself generates all the correct keys for all the COM-visible exposed types, using the regasm.exe utility
...which, yeah, you could run from PowerShell
but the registration requires admin privs
Rubberduck's installation page shows how we're doing it
 
2:10 PM
That part is done. Your tweet helped me with that ;)
And I tried copying your powershell. But it seems that it is intended for Add Ins rather than references. If that makes any sense.
Additionally this is the reason I need to register the TLB
http://stackoverflow.com/questions/39372179/excel-vba-late-bound-net-com-class-object-reference-not-set-to-an-instance-of
There's a bug that only appears if the class is late bound and no tlb is referenced.
 
I meant the regasm.exe part ;-)
@TomasZubiri you'll probably have to show the attributes of that Car class in order to get a definitive answer
    [ComVisible(true)]
    [Guid(ClassId)]
    [ProgId(ProgId)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    // ReSharper disable once InconsistentNaming // note: underscore prefix hides class from COM API
    public class _Extension : IDTExtensibility2
    {
        private const string ClassId = "8D052AD8-BBD2-4C59-8DEC-F697CA1F8A66";
        private const string ProgId = "Rubberduck.Extension";
every COM-visible class we have, has a [ProgId("string")] and a [Guid("guid")] attribute
 
If this works:
Part.NameInfo.value = Cells(1,1).value
But this doesn't
Part.CostInfo.convert = cells(1,2).value

Shouldn't I be focusing on the PartInfo attributes?

S
 
I'd give every COM-visible type a GUID and a ProgID
then you use regasm.exe to generate the corresponding registry keys :)
 
I believe I made .net automatically Generate a GUID because of reasons.
Is that relevant?
 
could be
 
2:17 PM
I hate COM thingies.
 
but the ProgId is what the VBA code will be using with CreateObject, so you need one
@TomasZubiri welcome to the club!
=)
 
Oh ok.
How you chose to develop an open source project with this technology is beyond me.
 
lol
because vanilla VBE sucks beyond words
 
I know, that's why I chose to go with .net and visual studio for the class.
But there's no escaping this nightmare.
I guess the sensible solution is to go full .net.
 
yeah.... and then you get other problems - because Excel itself is COM, so there's no escaping COM interop :)
 
2:24 PM
EPPlus seems fine for writing excels.
 
never heard of it
 
Haven't tried reading them yet.
As an added bonus, it doesn't actually need to open an excel window. And is quite faster.
+ Open Source
Fingers Crossed.
 
IDK, IMO the further you get from Microsoft's interop assemblies, the more subtle bugs you're likely to encounter
and the CodePlex license is dumb :)
oh, it's LGPL!
 
lol you're asking the wrong guy - I hate licenses with a passion!
 
2:30 PM
I'm starting to hate everything too.
 
it's not too bad when it's just one project with one license
 
.net has been ok. Which I guess puts it in the top 0.001% of technologies.
 
it gets annoying when your OSS project needs to start using code from other OSS projects with different licenses
like, very annoying
project A is under license XYZ which isn't compatible with license WXY used by project B, and so you're stuck either relicensing your own project, but then you were given piece of code ABC under the agreement that your project was under license JKL
 
3:03 PM
@WilliamCaman - Mat's Mug made a good point above - see the edit. — Comintern 16 secs ago
 
eh, I do that once in a while :)
that doesnt make any sense, the host document is already the variable "excelFile", with that piece of code I believe, you are trying to search a module with the name "ThisWorkbook" — Innat3 59 mins ago
^^ that one killed me
 
@TomasZubiri - It may actually be related to the binding. Take a look at this question, it might be relevant in your case too.
@Mat'sMug I was doing a pretty good job of just ignoring that one.
 
lol
What do you want me to do?  LEAVE?  Then they'll keep being wrong!
3
 
LOL - The alt text is perfect.
 
Zak
I'll give good odds on "VBA Developer" still being a stable profession in 2050.
 
3:20 PM
@Zak gosh what have we done
 
Zak
@Mat'sMug Made that profession just a little bit less-hellish.
 
3:33 PM
@Comintern I'll read the whole thing when I get some time. Could it still be relevant considering The bug dissapears when late bound but the tlb is referenced?
 
IMO, that's absolutely relevant
 
@TomasZubiri Yes. If there isn't tlb information associated with the object, VBA has to use its IUnknown interfaces. If it does have tlb information it uses its IDispatch interfaces.
 
3:53 PM
Can I set the TLB references through VBA code?
 
Yes - something like Application.VBE.ActiveVBProject.References.AddFromFile foo.tlb. You'd need programmatic access to the VBA extensibility objects though. Also, I'm pretty sure that you would need to exit completely afterward to force a recompile. Even if you didn't, I wouldn't try using a programmatically added reference without recompiling. That seems like a good way to crash the host application.
 
@Comintern RD adds (ensures there is, actually) a reference to the Rubberduck TLB and then immediately calls Application.Run to launch unit tests.. not sure a recompile is required - but then again, it's a VBIDE add-in, not the workbook itself
 
I'm so pushing for dropping excel and vba on future meetings.
 
well... sometimes it's the best alternative... just saying
 
Zak
@TomasZubiri You'd better have a really good business case for doing so.
 
4:08 PM
@TomasZubiri try here. convince me =)
 
@Mat'sMug Interesting. Has it been tested against a case where it had to add the tlb?
 
Dropping vba in favour of VB.net gives us access to visual studio, which in turn gives us access to:
Unit testing Tools
Performance Profiling Tools
Official Selenium
Wider Library Community
Wider and better stackoverflow community + documentation
Better Code sharing
Ability to run on server
Source Control

And the language itself gives us
Better error handling
Better OOP support
Better native error messages
 
pretty much every time someone adds a test module to the active project...
 
Is that too technical for a business case?
 
are VBA macros handled by IT?
FWIW Rubberduck gives you unit testing tools, source control, refactorings and VS-like navigation tools, right there in the VBE
 
4:14 PM
We are a small (5 people) team developing webcrawlers in vba.
 
unit testing?
 
I tried it. But it just isn't as robust as visual studio.
 
if VBA code is written and maintained by IT then you might have a case
@Jelly of course!
@TomasZubiri right. we're trying :-)
 
i will have to try RD in the future then
 
I don't get a reference when I add a test module - and the default test module uses Set Assert = CreateObject("Rubberduck.AssertClass")
 
4:15 PM
source control? can i push a macro to my github?
 
given push access, I guess
 
You have to export the modules and add them individually.
 
@Comintern ah, that's in the settings - it used to be early-bound by default
RD automates that (exporting/importing)
 
Oh you mean RD.
How do you handle the capitalization noise VBE generates on diffs?
 
you can't. that's just the price to pay for a case-insensitive language. same in VB.NET BTW
 
4:19 PM
Hmmm... So the late-bound just changes it to Private Assert As New Rubberduck.AssertClass and adds the reference. Is it actually executing the empty tests when you do that?
 
@Comintern why wouldn't it?
 
Because they're empty?
 
I was under the impression that VBE was modifying my variable names on its own. For example from myClass to myclass to MyClass.
 
if a test method exists, and we're asked to run it... we run it. if it makes no Assert calls, then the test simply passes
@TomasZubiri not on its own. try this:
Dim foo As Integer
and then
Private Sub Foo()
End Sub
 
Right, but does the insert test module trigger a test run?
 
4:22 PM
the variable foo will become Foo
@Comintern nope
just a reparse
 
Then there would be a recompile forced by adding the reference. I was referring to something more like adding the reference, creating an object from it, and using it in one code run.
 
oh, you mean the VBE itself decides to recompile?
hmm
yeah, wouldn't recommend that either
 
I'm looking into this to avoid messing with references.
https://msdn.microsoft.com/en-us/library/system.activator.createinstancefrom(v=vs.110).aspx
If I understand correctly. I can late bind and there should be no problem.
 
yay, reflection
 
It has to - the tlbs have changed. Access to a reference determines how it compiles the assembly that binds a method to an object.
 
4:26 PM
oops, meant this one:
https://msdn.microsoft.com/en-us/library/system.appdomain.createinstancefrom(v=vs.110).aspx
 
IMO there's seldom a valid reason to do that in .net - I'd do that if RD modules were plugins, for example.
 
@TomasZubiri How does that get you around the tlb problem? The VBA side is still going to see an IUnknown instead of an IDispatch.
The easiest solution would be to do what the Office apps themselves do - just expose everything as object that has to cross a COM boundary.
 
but what if you want IntelliSense?
(like the RD COM API)
then you need an interface, a GUID and a ProgID for everything, right?
 
Dual interfaces?
 
think so
    [ComVisible(true)]
    [Guid(ClassId)]
    [ProgId(ProgId)]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [ComDefaultInterface(typeof(IParserState))]
    [ComSourceInterfaces(typeof(IParserStateEvents))]
    [EditorBrowsable(EditorBrowsableState.Always)]
    public sealed class ParserState : IParserState, IDisposable
    {
        private const string ClassId = "28754D11-10CC-45FD-9F6A-525A65412B7A";
        private const string ProgId = "Rubberduck.ParserState";
 
4:36 PM
Activesheet. <- no IntelliSense
 
right. but that's because the active sheet isn't necessarily a Worksheet object
no?
 
I'd need to check the typelib, but I think it returns either object or variant.
 
either would work
 
Basically anything that is declared as object or variant has to be a late bound call.
 
but I think ActiveSheet can refer to some chart sheet
 
4:39 PM
I think you're right, actually. I don't use charts much.
Same thing with Range.Value - it returns a Variant because it can be either a primitive or an array.
 
lol, implementing/rewriting Excel in .net would literally break every .net guideline and best-practice
2
> DO NOT expose System.Object in a public API - check
basically the whole thing works because Variant and duck-typing
 
COM or Excel?
 
hmm
 
IDispatch is basically IDuckType.
...and Variant is Foo...
 
public interface IQuack : IDispatch { }
 
4:45 PM
lol
Foo.Quack <-- This is amazing feat brought to you by COM!
 
and this is why VBA will still be around in 2050
 
Somebody said that about COBOL in about 1965...oh wait.
 
What else would worksheets return other than a worksheet?
 
Worksheets contains only Worksheet objects - that's not the case for the Sheets collection though
 
5:00 PM
Then why not return a worksheet object instead of an object object?
Is the answer COM?
 
^^^Bingo
 
What an ancient curse.
3
 
A Worksheet is a specific interface. That means a caller has to have information about the interface in order to use it (i.e. a reference to a tlb). If you pass an object and let the caller query for the interface, you're all good. It's basically the reason for COM and the answer to "how can we change interfaces without creating a dll hell?"
 
All good points, but where is my intellisense.
 
in case you missed it:
in The 2nd Monitor, 6 mins ago, by Dan Lyons
http://tristancalderbank.com/2016/09/06/excel-messenger-a-terrible-experiment-in‌​-vba/
"Excel messenger" client-server spreadsheet chat
like.... wow
 
5:12 PM
"It worked but it wasn’t meeting the intense enterprise demands we were facing in the market. "
 
 
2 hours later…
6:42 PM
Application.Workbooks.Open(path) omfg, I spent hours googling and couldn't find that. — rlb.usa 42 secs ago
^ dupe
 
http://stackoverflow.com/questions/39372179/excel-vba-late-bound-net-com-class-object-reference-not-set-to-an-instance-of
Added class code which I believe is the cause of the problem.
 
@Mat'sMug I attempted to answer this question, but I'm not sure I got it right, I only know what I've learned from you. You can probably knock this question out of the park - superuser.com/questions/1121971/…
 
In this case sheet is using activeWorkbook implicitly too.
 
> This is proving to be much harder than I anticipated.

I have a failing test using this code:

Sub Test()
DoSomething (foo), (bar)
End Sub

From the failing test's stack trace, the parser correctly identifies a `callStmt`, then an `expression`, and then a `lExpression`, and parsing fails at the comma.

The `lExpresion` rule has higher precedence than the `parenthesizedExpr` that it should be matching, however moving `lExpr` anywhere below `parenthesizedExpr` completel
 
@Raystafarian lol, I don't even understand what he's asking
 
7:42 PM
Yeah it's worded strange, I think he's saying "How come a reference [selection] you make on one sheet is a valid address on a different sheet"
 
@TomasZubiri It's calling the CostInfo property of Part that causes the error. If you can post the stubbed out class code, I can take a look at it after work.
 
7:59 PM
@Raystafarian to me it's strictly a question about how Worksheet.Paste works when the Destination parameter is omitted
0
A: Change "selection" in inactive sheet. VBA

Mat's MugThe MSDN documentation for Worksheet.Paste method states, regarding the optional Destination parameter: A Range object that specifies where the Clipboard contents should be pasted. If this argument is omitted, the current selection is used. Since the current selection is on another workshee...

 
00:00 - 20:0020:00 - 00:00

« first day (824 days earlier)      last day (2356 days later) »