« first day (731 days earlier)      last day (2449 days later) » 
00:00 - 20:0020:00 - 00:00

12:00 AM
[retailcoder/Rubberduck] ThunderFrame pushed commit 45243293 to next: Adds MS Project Application.Macro method
Generalized RD's ignorance of IDispatch and IUnknown members. (#1699)

* Generalized RD's ignorance of IDispatch and IUnknown members.

* Quickfix for LONG_PTR => LongPtr
Adds Unit Test support for MS Project, adds basic bitmap copy of Code Explorer treeview (#1701)

* Adds RTF and XML Spreadsheet data formats

Still need to RTF-escape content values
Temporary Fix in InspectionResultBase, for instances of unsaved filename
boom.

* XML Spreadsheet builds from XMLWriter instead of StringBuilder

Adds ColumnInfos helper classes, for specifying and formatting column
titles, not yet fully implemented.

* Improves Clipboard export formatter

Adds a Docum
[retailcoder/Rubberduck] ThunderFrame pushed commit 53ffeb56 to next: Merge branch 'next' of github.com/rubberduck-vba/Rubberduck into next
Adds frikkin' Unit Tests in Outlook

yep, Unit Tests. in Outlook.
4
Merge pull request #1707 from ThunderFrame/next

Adds Unit Tests to Outlook
Merge pull request #119 from rubberduck-vba/next

sync with main repo
RELOAD!
[Cardshifter/HTML-Client] 1 issue comment.
[retailcoder/Rubberduck] 40 commits. 37669 additions. 23544 deletions.
[rubberduck-vba/Rubberduck] 38 commits. 5 opened issues. 20 issue comments. 37590 additions. 23530 deletions.
[VSDiagnostics/VSDiagnostics] 1 commit. 177 additions. 30 deletions.
 
12:14 AM
So I've been thinking, current build isn't perfect, but it's tons better than the alpha release. How about a beta?
 
12:42 AM
Do we collect the GUID or ProgID of COM types, and UserForm controls?
 
we could
not sure about controls though
 
 
2 hours later…
2:31 AM
@Mat'sMug did you implement the code that determines that ThisWorkbook is a Workbook using the approach of hashing the VBIDE properties for the component and comparing to COM references?
 
2:59 AM
Mary Meeker trend report for 2016 is out now. Interesting read to heard what's is developing and changed over the years. I used the slideshare version interesting how the generations is now encapsulated from slide 51 and 52. slideshare.net/kleinerperkins/…
And lastly the messaging evolution on slide 101. :)
 
 
1 hour later…
4:28 AM
@ThunderFrame outlook runs the tests, but I'm not collecting the results. are you?
 
4:40 AM
wow late-bound is so much faster...
but neither early or late bound works :(
 
5:15 AM
> Well this is strange:

On Commit: ccd6225f7bc752224ad494403ffb7dc469c29aa6

![image](https://cloud.githubusercontent.com/assets/10895412/15812542/747b332c-2bb6-11e6-9e7c-c6b991062021.png)
 
5:42 AM
> Some events in Excel require byval or byref arguments.

The Cancel isn't used so the inspection fires. but then die Fix breaks the code because vba requires cancel to be passed byref

This is required:
`Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) `

![image](https://cloud.githubusercontent.com/assets/10895412/15812851/ede54be6-2bb9-11e6-96c8-f855dc5b6bf1.png)
 
morning all... Well just me.
does @all work? Hi All
came looking to see what changed in the referenceDeclarationsCollector.
 
> You can test with this code:

```
Option Explicit

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, ByRef cancel As Boolean)

handler (cancel)
If cancel Then
MsgBox "Save canceled"
End If

End Sub


Sub handler(ByRef cancel As Boolean)


Select Case MsgBox("Cancel?", vbYesNo)
Case vbYes
cancel = True
End Select

End Sub

```
 
Still lots of code checked in with low checkin of any changes to testing. 3 new classes added, and no RubberDuckModule code changes. I think the intention of Injection has been lost? Certainly when I try and find a place to inject at, I get terribly lost trying to understand where to do it.
 
> Getting this crash when trying to close excel:

Just open it add a module and try to close excel

![image](https://cloud.githubusercontent.com/assets/10895412/15813047/f4b07e80-2bbb-11e6-842d-39911021150b.png)


```
private IntPtr WindowProc(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam)
{
try
{
var suppress = false;
if (hWnd == _mainWindowHandle)
{
switch ((WM)uMsg)
> Are you using 1.4 or the latest commit? If the latest there is a debug option in VS that can help point point where the code fails which is helping developers here
> See #1703
 
6:01 AM
Hey @Gareth!
 
> @PeterMTaylor Latest commit on next
And well i could add a screenshot of the locals.
The Callstack only shows [external Code]
![image](https://cloud.githubusercontent.com/assets/10895412/15813165/ef63c526-2bbc-11e6-880c-d3208ccf495b.png)

The last few Immediate Logs:

```
2016-06-06 08:01:19.3457;WARN;Rubberduck.Parsing.Symbols.TypeAnnotationPass;Failed to resolve type VBE;
Exception thrown: 'System.NotSupportedException' in Rubberduck.dll
Exception thrown: 'System.NotSupportedExc
 
6:32 AM
@Mat'sMug yes, I'm getting results. I have the screenshot to prove to myself that I'm not mistaken.
 
6:45 AM
@PeterMTaylor morning Peter
 
7:27 AM
@Mat'sMug I've added debug output to VBA test-setups and teardowns, and to the test methods. I get debug output as expected and I get results in Rubberduck Test Explorer.
I suspect you have Macros disabled. The default, IIRC, is to allow digitall signed macros, but disable all other macros without prompting.
I think you need to switch to notifications for all macros
If I revert that setting to "Notifications for digitally signed macros, all other macros disabled", (and restart Outlook) then Rubberduck shows all tests as having passed (which it obviously incorrect), but I don't think the problem is with Outlook. It appears to be an over-optimistic AssertClass that defaults method outcomes to passed?
 
 
1 hour later…
8:51 AM
just spotted this histerical post :) stevebennett.me/2012/02/24/10-things-i-hate-about-git
edit, damn! I can spell hysterical
 
 
1 hour later…
10:25 AM
> Using the Test Explorer commands in Excel 2016 32-bit, I added a test module, and a single test method, to an empty Excel 2016 project. And then, again using the Test explorer menu commands, added another test module and single test method. I then edited the name of the 2nd test module's test method name to TestMethod2 for clarity (although with scoping, I shouldn't need to). So, I have:

TestModule1.TestMethod1
TestModule2.TestMethod2

All other module/test initialization/Cleanup methods
 
 
1 hour later…
11:33 AM
> Well, I decided that me *Ending* the code when it was breaking wasn't helping, because it was destroying the Assert objects unnecessarily, so I commented out the line:
```vb
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
```
And then I get this output (indentation added for clarity):
```text
ModuleInitialize (TestModule2)
TestInitialize (TestModule2)
TestMethod2 (TestModule2)
TestCleanup (TestModule2)
TestInitialize (TestModule2)
TestMetho
 
@ThunderFrame wtf that's serious... can you fix it? @Hosch250 mind taking a look? Shouldn't be too hard to spot/fix, but it's a showstopper bug.
@ThunderFrame no, that's by design: the runner passes a test that makes no assertions
 
I wonder if we should change the ModuleCleanup bolerplate to destroy the Assert object on module teardown?
@Mat'sMug Did you check your Outlook Trust Center Macro Security settings?
 
Not there yet. Leaving home for work
 
12:43 PM
> On latest Next.

Given this code:
```
Declare Function CreateProcess Lib "kernel32" _
Alias "CreateProcessA" (ByVal lpApplicationName As String, _
ByVal lpCommandLine As String, _
lpProcessAttributes As SECURITY_ATTRIBUTES, _
lpThreadAttributes As SECURITY_ATTRIBUTES, _
> On latest next.

Given this code
```
Public Property Get Myrange() As Excel.Range
Set Myrange = Range("myname")

End Property
```

![image](https://cloud.githubusercontent.com/assets/10895412/15822245/e685845c-2bf4-11e6-802f-2320d37ad907.png)
The return value is assigned actually as seen in the code.
 
youtu.be/knlK3Hk8A1Y A pinball idea :-)
 
> Sample output (with 2 tests in each of 3 modules) ```text ModuleInitialize (TestModule3) TestInitialize (TestModule3) TestMethod33 (TestModule3) TestCleanup (TestModule3) TestInitialize (TestModule3) TestMethod3 (TestModule3) TestCleanup (TestModule3) ModuleCleanup (TestModule3) ModuleInitialize (TestModule1) TestInitialize (TestModule1) TestMethod11 (TestModule1) TestCleanup (TestModule1) TestInitialize (TestModule1) TestMethod1 (TestModule1) TestCleanup (TestModule1) ModuleCleanup...
(TestModule1) ModuleInitialize (TestModule2) TestInitialize (TestModule2) TestMethod22 (TestModule2) TestCleanup (TestModule2) TestInitialize (TestModule2) TestMethod2 (TestModule2) TestCleanup (TestModule2) ModuleCleanup (TestModule2) ```
[rubberduck-vba/Rubberduck] build for commit e24e5516 on unknown branch: AppVeyor build succeeded
 
1:40 PM
[rubberduck-vba/Rubberduck] ThunderFrame pushed commit e24e5516 to next: Fixes #1711 to run module-specific test methods, for each module
Merge pull request #1714 from ThunderFrame/next

Fixes #1711 to run module-specific test methods, for each module
 
@Gareth RubberduckModule isn't supposed to be modified much; by mere convention if a type implements an interface, that interface is automatically bound to the type that implements it, e.g. IFoo binds to Foo - unless you're getting an ActivationException and except for a few little things, there's normally little need to modify RubberduckModule.
 
[rubberduck-vba/Rubberduck] build for commit f39821b1 on next: AppVeyor build succeeded
 
 
1 hour later…
3:05 PM
> This isn't the same issue as #1703. The hooks shouldn't be waiting for Dispose to detach themselves - it probably should simply be handled in the WindowProc when a WM_DESTROY is received.
 
3:40 PM
Hi.
Ready to release, @Mat'sMug?
 
@Hosch250 what's up with #1712? also #1710 should be an easy fix
can #1712 be repro'd with a unit test?
 
That looks evil.
That's not even valid VBA.
Oh, because I'm on x64.
 
it is, it's a Declare statement, declaring an external function that returns a Long, yet we seem to not be picking up the return type
 
I need to add PtrSafe.
 
yeah, for x64; x86 doesn't need it
 
It didn't tell me so at first, because of the leading space :/
var node = GetNode(Context as VBAParser.FunctionStmtContext)
        ?? GetNode(Context as VBAParser.PropertyGetStmtContext);
It crashes the quick fix too.
 
interesting.. looks like node would be null for a DeclareStmt, no?
 
Obviosuly.
var signature = node.Signature.TrimEnd();
That is where it crashes--next statement.
 
should be a ... quick-fix lol
 
So, that's a library function?
 
yeah. let's just exclude those from the inspection for now
@Hosch250 once you got that down, let's get serious with release notes - make sure you spare an hour for me tonight, I'd like to not be at work when the release build happens :)
 
Sure.
What time?
 
around 9:30PM your time, would be great to have the release notes finalized by then though
(maybe a bit before... basically after I got the kids into bed and I'm ready to, well, Rubberduck)
 
I'll be doing the dishes then.
Well, I can try to get them done at 8 instead.
 
4:05 PM
or we can do this after the dishes, too - up to you
 
How do I assert that the parser picks up the as type as an as type statement in the parser tests?
Especially since there are 11 as-type-stmts in there because of the parameters?
 
only one is relevant, the one immediately under the DeclareStmt :)
 
Obviously.
But I don't get how to get them out.
private void AssertTree(VBAParser parser, ParserRuleContext root, string xpath, Predicate<ICollection<IParseTree>> assertion)
{
    var matches = new XPath(parser, xpath).Evaluate(root);
    var actual = matches.Count;
    Assert.IsTrue(assertion(matches), string.Format("{0} matches found.", actual));
}
How does that even work?
 
hmm @awgaya might help here
 
4:21 PM
Got it.
I just have to verify there are 11 of them.
It is there in the parse result fine.
 
so the problem is with the inspection then?
or the resolver?
 
Resolver, apparently.
Peculiar.
It has the correct as type.
!item.IsTypeSpecified
That isn't being set, though.
get
{
    return HasTypeHint || _asTypeContext != null;
}
Huh...
Found the guilty member.
ExternalProcedureDeclaration passes null in for that.
 
4:39 PM
bingo
well
no
 
Should be fixed.
 
ExternalProcedureDeclaration is a Declare Sub, which has no "as type"
so a null makes sense
 
Then what is the "as long" doing there?
 
there should be an ExternalFunctionDeclaration
Sub => "Procedure"; Function => "Function"
 
else if (declarationType == DeclarationType.LibraryProcedure || declarationType == DeclarationType.LibraryFunction)
{
    result = new ExternalProcedureDeclaration(new QualifiedMemberName(_qualifiedName, identifierName), _parentDeclaration, _currentScopeDeclaration, declarationType, asTypeName, asTypeContext, accessibility, context, selection, false, annotations);
}
Looks like there isn't.
 
4:41 PM
uh-oh
then that's it
 
Should I make one?
 
nah, doesn't look like the distinction would be useful
 
OK.
 
hi @MichaelBrandonMorris!
 
It just passes null in for those anyway.
Hi.
 
4:46 PM
that's the problem: if the DeclarationType is LibraryFunction then the "as type" isn't expected to be null
how is asTypeContext null anyway??
 
@Mat'sMug For subs.
 
so it's not null for functions, correct?
 
Right.
 
9 mins ago, by Hosch250
ExternalProcedureDeclaration passes null in for that.
 
Thing is, we weren't passing it in because we always expected null for procedures.
 
4:47 PM
then you lost me
 
We create the declaration in the listener, right?
So, we pass all the stuff into the ctor.
We didn't pass the asTypeContext into the ctor, but then we explicitly passed null into the base type for that parameter.
All I had to do was pass the asTypeContext variable into the ctor, then pass that down to the base type.
Right now, I'm killing ProcedureNode based on this comment:
// todo: remove usages of this obsolete class.
The quick fix uses that type, but doesn't work for library functions.
I need to fix it one way or another, so might as well kill that too.
 
while you're there, CommentNode can be moved to Rubberduck.Parsing.Symbols, and the Nodes folder can die
 
OK.
 
and after that I think pretty much nothing is left of the legacy RD 1.0 stuff that came from the original VBA code :)
 
5:07 PM
Hi @SimonForsberg! Welcome to your favorite room!
 
5:24 PM
@Mat'sMug Quack and thanks.
Chat is behaving strangely on me some times. I get pings that I don't understand why I get, and I can't find exactly which message triggered the ping or why.
Anyway, while I'm here, is there any tool to help with the translation? @Vogel612 had something, didn't he?
A tool to see the strings in all languages at the same time would be nice
that would make translation much easier
 
yup, and I used it for the French resources last week, works well. I filed a number of issues and he issued a new release
it took a little over 2 hours to go through everything... although I think I might have missed a few ones, things look funny on my fr-CA laptop at work
 
Ok great. I'll look into that tool then
 
5:40 PM
#1710 might not be that straight-forward after all.
I was going to throw out a quick over lunch fix to detach hotkeys on WM_DESTROY and discovered that it isn't even receiving a WM_DESTROY message.
 
oh
I need to pick up lunch, bbl
 
You sure eat late.
 
[Hosch250/Rubberduck] Hosch250 pushed 51 commits to Issue1712 (only showing some of them below)
Adds Unit Testing for MSProject

Application.Run() does exist but doesn't seem to work, so using
Application.Macro() instead.
[Hosch250/Rubberduck] ThunderFrame pushed commit 45243293 to Issue1712: Adds MS Project Application.Macro method
Generalized RD's ignorance of IDispatch and IUnknown members. (#1699)

* Generalized RD's ignorance of IDispatch and IUnknown members.

* Quickfix for LONG_PTR => LongPtr
Adds Unit Test support for MS Project, adds basic bitmap copy of Code Explorer treeview (#1701)

* Adds RTF and XML Spreadsheet data formats

Still need to RTF-escape content values
Temporary Fix in InspectionResultBase, for instances of unsaved filename
boom.

* XML Spreadsheet builds from XMLWriter instead of StringBuilder

Adds ColumnInfos helper classes, for specifying and formatting column
titles, not yet fully implemented.

* Improves Clipboard export formatter

Adds a Docum
[Hosch250/Rubberduck] ThunderFrame pushed commit 53ffeb56 to Issue1712: Merge branch 'next' of github.com/rubberduck-vba/Rubberduck into next
Adds frikkin' Unit Tests in Outlook

yep, Unit Tests. in Outlook.
Merge pull request #1707 from ThunderFrame/next

Adds Unit Tests to Outlook
[Hosch250/Rubberduck] ThunderFrame pushed commit e24e5516 to Issue1712: Fixes #1711 to run module-specific test methods, for each module
Merge pull request #1714 from ThunderFrame/next

Fixes #1711 to run module-specific test methods, for each module
[Hosch250/Rubberduck] Hosch250 pushed commit c4aea624 to Issue1712: Close #1712
 
@Hosch250 in the elevator now ...geez I'm starving
 
[rubberduck-vba/Rubberduck] build for commit c4aea624 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] Hosch250 pushed commit c4aea624 to next: Close #1712
Merge pull request #1715 from Hosch250/Issue1712

Fix Implicit Variant Function Return Type
> Discovered this when I was doing some testing on how COM objects get released in the GC, and confirmed while testing a putative fix for #1710. This is very likely the cause of some of the weird shutdown errors, i.e. #1710, #1633, #1533, and #1438 (might be more, that's just a quick scan). These appear to be reporting "random" exceptions when closing because the exception that gets thrown would depend on the what the background thread is doing when tries to access something that the main thre
[rubberduck-vba/Rubberduck] build for commit aeb361d3 on next: AppVeyor build succeeded
 
6:17 PM
@Comintern So, we need to join all the threads on shutdown.
 
Yep. When the COM objects are GC'd in the main thread the finalizers are getting called on the RCWs. That lets the host destroy the objects because the reference counts all zero'd out. I'm not exactly sure why the runtime lets them do that, but it might have something to do with .NET's STA COM threading not complying 100% to the COM spec.
 
Can it be fixed by tonight? If so then I think we'll be ready for a beta then
Note: I've no idea how to go about this
 
Oh boy.
 
@Hosch250 probably knows more about the threading code than I do. There's code in the Dispose method of StaTaskScheduler to join all of the parser threads, but I'm not sure how to access it from App.
 
The parser changes broke absolutely everything.
Me either.
If I had a handle on the threads, it would be easy.
I'm not sure what I have, though :/
Hang on a sec, I'm fixing 101 refactoring bugs.
 
6:29 PM
@Hosch250 how? Aren't the tests passing? What's going on?
 
Yeah, I was looking for one. AFAICT, Ninject is handling that under the hood.
 
@Mat'sMug You rely too much on the tests.
!(parameter.Context.Parent.Parent is VBAParser.DeclareStmtContext));
Well, that was written before the parser change.
That is in Param Not Used.
So, guess what? Declare statement and event statement parameters...
Get it?
parameter.ParentDeclaration.DeclarationType != DeclarationType.Event
That should fix it for now, but we didn't have that when this was first written.
Procedure can be written as function is reported for events too...
 
The parse tree changed and the condition is broken, and there's no test that covers that code path?
 
Which is a Very Bad Thing(TM)
@Mat'sMug We don't load events in the tests...
Yeah, it shouldn't be too hard to write a custom event...
 
We don't load the built-in ones
 
6:32 PM
@Mat'sMug Did you forget that we don't even have a bunch of things under test...
Just because the tests pass doesn't mean anything works, as we found with the SC in 1.4.3...
 
lol, yeah
 
> handler (cancel)

@joshuader6 you're aware that this passes `cancel` by value, regardless of the `ByRef` specifier in `handler`?

That said built-in events *should* be recognized as such now, and ignored by the inspection, so that's definitely a bug.
> Peculiar. It isn't being picked up as an event on my machine, or even as a built-in. I have this in ThisWorkbook...
> @retailcoder wait what ? isn't cancel evaluated after the event and is used to cancel the save ?
so it has to be byref right ? you're totaly confusing me now ...
 
@Mat'sMug @awgaya Think I found a bug.
Option Explicit

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, ByRef cancel As Boolean)
End Sub
When I stick that in ThisWorkbook, it isn't being picked up as an event.
I think it is because the component name is ThisWorkbook instead of Workbook...
 
> Given:

Sub DoSomething(ByRef foo As Integer)
foo = 42
End Sub

Then this code:

DoSomething (bar)

Passes `bar` by value (`ByVal`), which can lead to unexpected bugs, as demonstrated with this code:

Sub Test()
Dim bar As Integer
DoSomething (bar)
Debug.Print "Back into 'Test', bar is " & bar
End Sub

Sub DoSomething(ByRef foo As Integer)
foo = 42
Debug.Print "In 'DoSomething', foo is " & foo
 
It's declared in the tlb IAppEvents interface as function WorkbookBeforeSave(Wb: ^Workbook; SaveAsUI: Bool; out Cancel: ^Bool): HResult; stdcall;
 
Which interface is it looking at?
 
> @joshuader6 see #1717
 
@Comintern It should be picking it up as an event as defined in WorkbookEvents.
 
ah, crap. the problem is that ThisWorkbook isn't known to be a Workbook.
this is getting really annoying and problematic now
 
Oh.
Well, maybe that makes that event thing working still...
 
6:50 PM
how about we hard-code ThisWorkbook : Workbook and prohibit renaming ThisWorkbook? Any document module in Excel that's not named ThisWorkbook has to be a Worksheet then..
gosh I hate this
 
Nope, broken.
@Mat'sMug Still renamable...
 
yeah, from vanilla VBE.
 
> this is .... why is this ?? ... why is vba doing things ?? so basically you say
`DoSomething(bar) `= byval
`DoSomething bar` = byref

but what if

`if somefunction(byrefarg) = true then ... ` <-- there the parentheses is mandatory
 
we need to handle this... somehow
 
Kind of like the Option Explicit thing, where RD just won't work without it?
 
6:52 PM
hey guys
 
Hi.
 
hi @JoshK, looks like I just traumatised you? lol
 
You just exposed 101 bugs, and probably delayed the release by another week...
 
@Mat'sMug i am basically done for today :D why is it doing this ??
 
6:54 PM
@JoshK Several reasons.
 
[Hosch250/Rubberduck] Hosch250 pushed commit 3f7c3cd7 to InspectionBugs: Correctly check param-not-used for events and library procedures/functions
 
First, the parser was rewritten, breaking many inspections which relied on the nodes being in a certain order.
Secondly, we aren't able to resolve what member is the workbook.
 
For ThisWorkbook -> Workbook. Can we query to see if it has a Workbook specific class property, like EnableAutoRecover?
 
@Comintern Sure.
As long as it isn't host-specific.
 
> The parens are mandatory in a *function* call; in a *procedure* call they basically force VBA to *evaluate* the parens-enclosed argument as a *value*, and pass it as such, effectively overriding the `ByRef` specifier.

So assuming a `Sub DoSomething(ByRef foo)` signature, `DoSomething (bar)` is force-passed by value.

In the case of a function, the same holds true - assuming `Function SomeFunction(ByRef foo)`, then `If SomeFunction((bar))` is force-passing `bar` by value, again overriding
 
6:56 PM
Workbook is host specific. You'd have a hard time adding that class in Word. ;-)
 
Oh, lol.
 
@Comintern that was @ThunderFrame's original idea; I hadn't gone there because I was hoping to find a way to get the actual type name from somewhere reliable, that wouldn't require host-specific code
6
Q: How do I know that `ThisWorkbook` is a `Workbook`?

Mat's MugI'm working with the VBIDE API, and can't assume that the host application is Excel, or any Office app either. So all I know is that I'm looking at a VBComponent, and that its Type is vbext_ct_document. In the VBE's immediate pane I can get this output: ?TypeName(Application.VBE.ActiveVBProjec...

 
@Hosch250 i meant the vba thing with parenthesis forces byval
 
K.
 
> @retailcoder

> Has anyone succeeded in creating a docked toolwindow with the NetOffice PIA's?

[This works for me](https://github.com/transistor1/ComAddinTest).
> i never understood the concept of omitting the parenthesis because
`Call MySub(arg , arg2) ` looks a lot nicer to me then `Mysub arg, arg2`
And now you're saying me that they do behave so drastically different ?
This is just another creepy thing about vba :D

Funny side note: I've been doing the parenthesis thing everytime with the `cancel` thing and i never noticed this behavior.
 
7:05 PM
You don't need the type name - all you need to know it has a specific property that only documents have.
 
@Mat'sMug More bugs...
 
> @transistor1 did they fix the *force focus* bug? The VBIDE API doesn't always correctly set the focus where we tell it to, and per #617 using NetOffice would break the (quite important) hack we're using to force-focus a given selection.

Also, to be honest I'm not too eager to switch to NetOffice anyway, especially since we don't *only* have Office PIA's referenced - having different abstraction levels for what amounts to the same concern (interacting with the host app and the VBE), doesn't
 
This is probably generally applicable to all documents:
?TypeName(Application.VBE.ActiveVBProject.VBComponents("Sheet1").Properties("Saved").Object)
[Doesn't support this property or method]

?TypeName(Application.VBE.ActiveVBProject.VBComponents("ThisWorkbook").Properties("Saved").Object)
Nothing
 
Sheet1 and Worksheet_EventName
I need to write tests for these...
 
@Comintern well, the resolver does need the type name ;-)
 
7:08 PM
And more for class modules and user forms.
@Mat'sMug It is using the type name too much.
 
...
 
> This was the concept i was used to ...
`call DoSomething(bar)`= byref
`DoSomething bar` = byref
`call DoSomething((bar))`= byval <-- only this should force byval

https://msdn.microsoft.com/en-us/library/chy4288y.aspx

But that seems to be only VB.net right ?
 
fine, give me a GUID then
 
> It appears that behavior is inherited from VB.NET's VB6 ancestor, which VBA pretty much is.
 
@Hosch250 what else would you use?
 
Look at that issue I just created.
 
> This code should resolve to an event. It resolves to a procedure because it is stuck into `ThisWorkbook` instead of `Workbook`. The same problem exists for `Sheet1` and `Worksheet` and `Class1` and `Class` and `UserForm1` and `UserForm` events. Standard modules do not have built-in events, so they don't have this problem.
```
Option Explicit

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, ByRef cancel As Boolean)

handler (cancel)
If cancel Then
MsgBox "Save canceled
> ref. #1709
 
That is pretty much the root bug in these inspection bugs.
I'm writing the failing tests now, but I'm not sure what it will take to fix this in the resolver.
 
all it takes is the declaration for ThisWorkbook to have Workbook for its AsTypeName
 
> I should note that this code is in a sheet module
 
7:15 PM
"all it takes" lol
 
OK.
 
well, and Sheet1, Sheet2 and Sheet3 (and SomeSheet) to have Worksheet for an AsTypeName
 
And ClassModule and UserForm?
 
UserForm shouldn't be a problem, we can tell it's a form from its vbext_ct_Type
..as for class module events, AFAIK (did that change?) we were explicitly special-casing / excluding Class_Initialize and Class_Terminate handlers
everything else is user code
 
OK.
 
7:20 PM
we need some kind of a strategy pattern here, depending on the host.
e.g. class ExcelDocumentModuleStrategy, WordDocumentModuleStrategy, DefaultDocumentModuleStrategy
gosh this sucks
 
@Mat'sMug The Class and UserForm ones are picked up as procedures too.
For class modules, the AsTypeName is the name of the class.
@Mat'sMug Can you send my report over?
 
just special-case Class_Initialize and Class_Terminate, they're always going to be just these two, and AsTypeName must be the name of the class
@Hosch250 thank god you asked :)
 
> > did they fix the force focus bug?

I don't think I came across a description of this bug directly, except that I saw a reference to it [here](https://github.com/rubberduck-vba/Rubberduck/pull/617#issuecomment-111698129), but I can certainly look at it if you point me to the Rubberduck code that handles it

FWIW, Each NetOffice object has an `UnderlyingObject` property, which points directly to the COM object if it is needed, so I'm sure the hack mentioned by @ckuhn203 could probably be
 
7:37 PM
Ugh, this is a mess...
 
@Duga dude, forget it, I'm not moving to NetOffice.
 
@Mat'sMug Doesn't the as type name of Sheet1 need to be Sheet1?
 
crap
yes, but its implemented interfaces need to include Worksheet
ditto for ThisWorkbook / Workbook
 
OK.
I'm all messed up now.
 
00:00 - 20:0020:00 - 00:00

« first day (731 days earlier)      last day (2449 days later) »