« first day (1958 days earlier)      last day (1222 days later) » 

12:00 AM
Later!
 
RELOAD!
[rubberduck-vba/Rubberduck] 2 opened issues. 2 closed issues. 14 issue comments.
[Minesweeper] Games Played: 70, Bombs Used: 47, Moves Performed: 10479, New Users: 7
 
 
3 hours later…
2:47 AM
hm, I'm missing something... how do I get the annotations off a QualifiedContext?
 
2:58 AM
or would the context itself only ever be an AnnotationContext?
shrugs
 
 
2 hours later…
4:52 AM
Have a good night everyone.</iven>
 
5:39 AM
[rubberduck-vba/Rubberduck] build for commit 4d0c038c on unknown branch: AppVeyor build succeeded
 
 
2 hours later…
7:37 AM
@MathieuGuindon I think you have to look whether there is an annotation for that line via the DeclarationFinder.
 
 
3 hours later…
 
2 hours later…
1:14 PM
OMG! OMG! OMG! The sky is falling!!!!111!!11!!one!!
> Microsoft is ending support for Windows 10, version 1703 as of Wednesday, Oct. 9.
-IT email send on 15 Oct
> The upgrade will take up to 2 hours
really? I know Win updates are slow, especially Win10 updates, but 2 hours??
> Here's how to upgrade your machine... ...If you don't prepare for BOOM shutdown at 6pm on 10/24 when we do it do you
Ahhhh... I love our IT dept...
They're updating us to Win10 build 1803 released 30 April 2018 because we like to live right on the bleeding edge.
According to that link, build 1803 will EOL 1 year from now. That is planning ahead!
(ass-u-mes we're on Enterprise, otherwise, it's good for a month...)
 
2:16 PM
Oct 2 at 12:32, by FreeMan
If I have code in an Excel host, can I create an Access object, open an Access .accdb and call a public method within the code hosted there?
Oct 2 at 12:32, by this
You can.
@this how?
Oct 2 at 12:32, by Mathieu Guindon
@FreeMan people ask about that all the time on SO =)
@MathieuGuindon Got some search terms to recommend?
 
well, the traditional entry point would be Application.Run.
 
I'm not finding anything useful beyond accessDB.DoCmd.RunMacro and I think I'd like to avoid...
ah...
 
#ProTip: If it's in DoCmd, it's wrong.
2
 
I don't think I'd made it that far down the OB to find Run yet
 
accessDB.Application.Run should work fine?
 
2:18 PM
#ProTip 2: Application (or rather, any appobject) is your friend
 
Yeah... I've got
  Dim roiDB As Access.Application
  Set roiDB = OpenDatabase("H:\git\ROIReport\ROIReport.accdb")
 
Note that as an alternative if you want it totally automated (but not headless!), you can pass command line switch to run code.
uh, no?
 
and discovered that I cannot now Dim foo as roiDB.myClass which kinda sucks...
 
I think that's basically true for anything that's external to your VBA project.
 
Private Function OpenDatabase(ByVal path As String) As Access.Application

  Dim database As Access.Application
  database.OpenAccessProject FilePath:=path, Exclusive:=True

  Set OpenDatabase = database

End Function
@this ^
 
2:20 PM
e.g. you'd get the same behavior w/ your Excel Add-in for example.
uh.
 
@this Pretty much figured that...
 
local variable?
I don't think that's what you want.
At least the Access.Application ought to be a module-level variable.
Or it won't live long enough.
Also, I have my doubts about OpenAccessProject. I think that works w/ ADP files.
 
The whole access DB has some setup that it goes through to determine if it's running in Dev or Prod, then there are some classes that need to be set up and finally run the method that downloads all the necessary files.
 
well, you still have to have an entry point to it.
e.g. a public method in a standard module so that you can invoke via Application.Run
or if you'd rather, via the command line switch.
 
Yeah... This is going to be a big bite. I'm not sure that the access code is really amenable to being called this way. May take some access refactoring to make it so. Which wouldn't be a bad thing in the long run...
 
2:25 PM
My caveat stands:
Oct 2 at 12:33, by this
I get automating Excel from Access, but vice versa.... that's weird.
 
yeah... maybe I'll look a a command line switch. I can set it in the scheduled call and if it's missing it assumes interactive...
then I can just schedule a launch of the .accdb itself...
ok... back to the drawing board.
 
2:38 PM
@FreeMan I think you forget to actually create your application object in your function.
 
or he's accidentally using the implicit instance (which would lead to problems)
 
It is a member access, but the variable is not initialized.
Set database = New Access.Application is missing.
 
Yes - I assumed that we don't have the entire code, and if it's missing yet he is able to use the object without errors about it being not set, then that means it got assigned the default instance. I've seen people do that by mistake.
 
BTW, I do not see your problem with the local variable. The object is passed out as the return value.
 
Yes. #NeedCaffeine.
 
2:46 PM
Whenever I have to do something like opening another application, I actually write a wrapper class to ensure that the application quits once the object goes out of scope.
 
Yeah, I usually do that though I also have a module to provide the instance of the application (particularly to work around the quirkness of Outlook)
 
@M.Doerner yes, thank you. I did realize that
 
3:01 PM
> **Rubberduck version information**
Version 2.4.1.23886
OS: Microsoft Windows NT 10.0.18362.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.12026.20320
Host Executable: EXCEL.EXE


Rubberduck does not find/recognize hidden enum member references.

**To Reproduce**
1. Create module with the following content:
```
Option Explicit
Enum FruitTypes
[_First] = 1
Apple = 1
Orange = 2
Plum = 3
[_Last] = 3
End Enum

Public Sub Test()
MsgBox CSt
> Given the following:

```
Public Enum FruitType
[_First] = 1
Apple = 1
Orange = 2
Plum = 3
[_Last] = 3
End Enum

Sub DoSomething()
MsgBox CStr(FruitType.[_First])
End Sub
```
The References collection for Enum Member [_First] is empty. It does not recognize `MsgBox CStr(FruitType.[_First])` as a reference. This issue is described further in #5228
> This seems to be a duplicate of #3238.
 
3:20 PM
@Duga Not like I've never done that...
 
@Duga - I even used the same code as the example! Two years is apparently the limit of my recall capabilities. :(
 
@BZngr two years isn't bad... I struggle at two weeks!
 
@Duga Search for enum hidden, profit.
 
4:05 PM
Does this need to have an issue reported:
2019-10-16 12:03:10.8715;WARN-2.4.1.5086;Rubberduck.Inspections.Rubberduck.Inspections.Inspector;System.InvalidCastException: Unable to cast object of type 'Rubberduck.Parsing.Symbols.ExternalProcedureDeclaration' to type 'Rubberduck.Parsing.Symbols.ModuleBodyElementDeclaration'.
   at Rubberduck.Inspections.Concrete.EmptyMethodInspection.<>c__DisplayClass1_0.<DoGetInspectionResults>b__0(Declaration member) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Concrete\EmptyMethodInspection.cs:line 45
hey, @skiwi! How many browser tabs do you have open today?
:)
 
4:20 PM
@FreeMan 2174 on my main window
 
Oct 9 at 14:30, by FreeMan
in Coding Projects and Vue.js Heaven :), yesterday, by skiwi
I managed to close 5 tabs! :)
Oct 9 at 14:30, by FreeMan
^ One of the signs of the apocalypse, isn't it?
:D
@all - is it possible to set the command line parameter(s) in the VBE and run in debug mode?
 
?
not sure I follow. Are you referring to Access command line?
 
4:38 PM
@Duga @this What was getting at is that if the converter is to behave like VBA code, the behaviour should not depend on the user's culture.
 
that's why the overload without locale?
 
The user's culture as perceived by .Net is usually the wrong culture anyway.
It is the culture of the OS install and not of the host.
 
in my test yesterday, it was the OS that determined the behavior
 
Also for VBA code?
 
e.g. if I changed my Windows regional setting to german formats, the VBA's treatment of 04/13/2000 and 04/12/2000 becomes 2000-04-13 and 2000-04-12.
Yes I tested in both the VBIDE and in the NUnit
they concide.
 
4:41 PM
Huh?
That is strange as it differs from the treatment of date litterals.
 
in my VBIDE tests, I simply did Dim d = "04/13/2000" : Debug.Print Format$(d, "yyyy-mm-dd")
e.g. no explicit conversions
that is not a date literal, btw
that's converting a string that is formatted like a date in some undefined locale to an actual date
how "13/04/2000" get parsed by VBA will depend on what windows regional is.
 
@this Yes. Sorry, realize that wasn't explicitly clear...
 
This tells me that VBA is messed up even more than I thought.
2
 
In german, that'd be 04.13.2000, but in US, that'd be 04/13/2000 since there's no 13th month.
That's why I've been using those 2 dates in particular.
those test cases simply server to assert that the conversions we get via the VariantConverter will be same as VBA does it.
 
If it really used true culture specific date formats "04/13/2000" would not be legal in de-de.
 
4:46 PM
(which shouldn't be that surprising since I'm 99% sure VBA internally uses the same oleaut functions)
I know, I know.
but VBA is far tooo goosey-loosey.
MUST PARSE ALL!, it thinks
Anyway that's why I think there's a new opportunity to provide users with methods to perform locale-sensitive (or insensitive) tests to help them avoid pains with implicit localization VBA + OS may foster.
 
this is an excellent question. My first instinct is to make it early-bound, but I'm not seeing anything that allows one to specify which version one is creating.
Of course, if you only have one referenced in the project, then you're guaranteed to have the correct one...
notes that the default Reference Manager is a nightmare and runs screaming back to the Duck
 
5:19 PM
> This PR addresses the invalid cast exception reported by @daFreeMan in chat. > 2019-10-16 12:03:10.8715;WARN-2.4.1.5086;Rubberduck.Inspections.Rubberduck.Inspections.Inspector;System.InvalidCastException: Unable to cast object of type 'Rubberduck.Parsing.Symbols.ExternalProcedureDeclaration' to type 'Rubberduck.Parsing.Symbols.ModuleBodyElementDeclaration'. > at Rubberduck.Inspections.Concrete.EmptyMethodInspection.<>c__DisplayClass1_0.<DoGetInspectionResults>b__0(Declaration member) in...
C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Concrete\EmptyMethodInspection.cs:line 45 > at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() > at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() > at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source) > at Rubberduck.Inspections.Abstract.InspectionBase.GetInspectionResults(CancellationToken token) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Abstract\InspectionBase.cs:line 112...
> at Rubberduck.Inspections.Rubberduck.Inspections.Inspector.RunInspection(IInspection inspection, ConcurrentBag`1 allIssues, CancellationToken token) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Inspector.cs:line 179;System.InvalidCastException: Unable to cast object of type 'Rubberduck.Parsing.Symbols.ExternalProcedureDeclaration' to type 'Rubberduck.Parsing.Symbols.ModuleBodyElementDeclaration'. > at...
Rubberduck.Inspections.Concrete.EmptyMethodInspection.<>c__DisplayClass1_0.<DoGetInspectionResults>b__0(Declaration member) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Concrete\EmptyMethodInspection.cs:line 45 > at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() > at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() > at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source) > at...
Rubberduck.Inspections.Abstract.InspectionBase.GetInspectionResults(CancellationToken token) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Abstract\InspectionBase.cs:line 112 > at Rubberduck.Inspections.Rubberduck.Inspections.Inspector.RunInspection(IInspection inspection, ConcurrentBag`1 allIssues, CancellationToken token) in C:\projects\rubberduck\Rubberduck.CodeAnalysis\Inspections\Inspector.cs:line 179
 
@Duga I guess the answer was "yes, but don't worry about it"...
 
[rubberduck-vba/Rubberduck] build for commit 180d9a15 on unknown branch: AppVeyor build succeeded
 
@FreeMan Not sure if it is actually an issue that the inspection does not inspect ExternalProcedureDeclarations...so, I just addressed the exception.
 
5:49 PM
@BZngr I'd think anything that throws a WARN in the log is an issue of some sort that could use a good dressing, but I'm good with your method, too. :)
 
6:07 PM
hrm... seems you can't create a ListBox in code...
  Dim foo As Access.ListBox
  Set foo = New Access.ListBox
generates error 429 ActiveX component can't create object
and skipping the Set then trying foo.ListCount gives a 91.
Up until that moment, my clever solution was working very well.
yesterday, by M.Doerner
And we all know how well clever implementations do.
 
why would you new it up?
it was never creatable.
If you are actually trying to create forms via code, you use the CreateControl method
 
6:23 PM
I pass the control from a form to a method that populates it. Since I'm now bypassing the form (running it when a command line parm is set), I need to be able to pass a ListBox in to populate it then pass that to the procedure that loads based on what's been selected in the list box.
 
uh.... you're automating. Why are forms and controls even in the picture?
What exactly are you trying to do?
 
What I just realized was that newing up the form on which the ListBox normally resides gets it populated as part of the on_activate, so Dim myForm as theFormInQuestion gets me a populated ListBox which I then pass to the procedure that loads the data.
 
but.... the procedure can take a value instead of a reference to control.
 
well, OK, Dim... followed by Set myForm = New... gets me a populated listbox
but the procedure was written to work off the listbox as populated.
 
I follow that, but I still don't see why you must have forms involved. This is all data, zero UI.
You can even modify the procedure to use a DAO.Recordset instead
then it would be independent of any forms/controls.
 
6:27 PM
I'm certain there are at least a dozen better ways to do this than the one I chose, however, this is how it works at the moment...
 
and you're saying you absolutely can't change the Access code?
 
I've got 4 sets of ListBoxen on the form. Click "Load Data" and it calls the Load routine passing in each of the list boxes and a param to indicate which type of data is being loaded.
 
(which only confuses me since I thought you already were modifying it to run automated by Excel)
Ok, still not seeing why listboxes must be passed.
 
Oh, I can change the code. I'm just not gonna at the moment because I want to get this working.
 
Here's the thing. Not changing the code is going to end up in more work.
 
6:29 PM
1) Make it work
2) Make it right
3) Make it fast
I'm on step 1
 
I understand but I'm trying to tell you that using forms and controls in automation scenarios is .... fragile and labor-intensive.
By refactoring your procedures to take data instead of control references, you can avoid all that messiness....
are listboxes mutli-select?
 
making it work frees up the time I'm spending running processes by hand to be able to refactor to make it better.
Yes, multi select.
I'll need to pass in some sort of list and transfer the ListBox selections to the list being passed in. Not a huge issue, just needs to be done.
and... time to put out a fire elsewhere. :/
 
Yes, you do. I'm assuming the rowsources doesn't have a Selected columns.
In which case, you can fill up some array from the ListBox.ItemsSelected and then pass that array.
Look, ma, no listbox reference!
 
No, no .rowsource on the listboxen. One of the conveniences is that I have a proc that populates the ListBox. Guess I'll modify that to populate an array now, add a proc to populate the ListBox from the array (for form use) then be able to reuse the exiting (modified) proc to populate the array for the automated process, too.
maybe it isn't as big an effort as I was thinking.
A lot of this code is old. Written before I'd met the duck and started to learn better, so it was of the Make it work variety, with little to no effort to Make it right.
mostly 'cause I didn't know what right was.
 
6:51 PM
I get it. I do really think that's a time to refactor, even if you're in a rush to get it working because otherwise, you end up taking more time fighting with the UI you didn't even need.
 
7:12 PM
@BZngr That was exactly the right fix.
 
I think those PRs are ready to be merged: 5203, 5207, 5212, 5224, 5227, and 5229. The 5226 just need a bit more review. Not sure if 5202 is already ready to be merged given the open question RE: VB6 tests.
 
Dear Excel. I know you love me and don't want me to leave, but that's no excuse to be immature and crash every time I try to close you. Love, Me.
 
hmm that's not the duck crashing, right?
just being paranoid
 
7:32 PM
No. it's just stupid Excel. It'll do it even if I've never opened the VBE.
I've been having semi-regular Excel crash-on-exit issues since I got upgraded to a new machine. I don't think this one has as much RAM as my old one did - that may well be the issue.
maybe I should check for Office updates instead of waiting for corporate IT to decide to push them...
On the bright side Make it work worked. Now on to Make it right.
 
FWIW, I've noticed Access crashing more lately on different machines.
 
i.e. time to refactor from passing a ListBox around to passing around a 2 dimension array.
 
Good boy. I'm sure that was a time well-invested.
 
you misread me. Make it work was Newing up the form and passing the ListBox.
that took all of about 3 minutes once it occurred to me.
now for the much more insidious task of weeding out all the references to the listbox and replacing them with better references.
yesterday, by M.Doerner
And we all know how well clever implementations do.
sigh...
#GettingLotsOfMileageOuttaThatQuote
Dumb question: Say a guy wanted to move from his own source control import/export routines to using OASIS-SVN for that purpose. What's the best way to update everything in git since all the file names and locations will be changing?
 
a new branch, maybe?
 
7:38 PM
move/rename files one at a time so they point to the new location/name? Drop the whole repo and start from scratch? Delete old name, add new name?
 
Question for the Pond. Anyone know of a reputable SQL style guide (book/online reference)?
 
just to format SQL? That's a new one. I've never seen any kind of agreements on how to style SQL.
 
7:54 PM
yeah basically - maybe something like sqlstyle.guide but not sure if that's reputable
 
nice. didn't even know about it.
 
but not surprised that there is not a consensus
 
Yeah, but it is kind of pathetic.
it is a standard....
 
that site also mentions Joe Celko’s SQL Programming Style, not sure if that is reputable either
 
Joe is opinionated.
 
7:56 PM
hahah ok
good to know
 
I don't mind the "middle-aligned" but I don't see it as practical
 
yeah ok that's what I figured but wanted someone else's view
 
am I going to take several extra seconds/minutes to make it all align in some centerline that I can't see?.... No, thanks.
so I tend keep it all left-aligned, with indentations.
with K & R bracing
which AFAIK, nobody else does. :(
I do agree with some of the points -- e.g. preferring singulars over plurals
this is a sampling of how I style my SQL.
SELECT
  t.foo,
  t.bar,
  t.baz
  o.foobar,
  o.barfoo
FROM dbo.something AS t
INNER JOIN duo.other AS o
  ON t.ID = o.SomethingID
WHERE t.foo = 123
  AND o.foobar >= '2019-01-01'
  AND o.foobar < '2020-01-01'
  AND NOT EXISTS (
    SELECT NULL
    FROM dbo.lame AS l
    WHERE o.ID = l.OtherID
  );
Like I said, bastardized, cowboy-em-up style. :)
 
I get putting every single column on its own line, but I hate how much space it takes up. I tend to bunch 'em all up on one line.*
 
For stored procedure, I follow noun-verb convention.
 
8:02 PM
TBF - that does make it more difficult when doing an INSERT
 
that way it nicely group a subject matter together.
 
* or two lines if it gets excessively long. For some value of "excessive"
 
I might not use line breaks for each columns if it's only 2 or 3 columns but...
after a point, reading it vertically is much easier. Besides, you have split for that reason.
 
split?
 
yeah in Window menu?
 
8:04 PM
ah!
 
> Do not use database server specific keywords where an ANSI SQL keyword already exists performing the same function. This helps to make code more portable.
LOL
hmm some advice given are questionable.
aw, c'est la vie.
> Keep the length to a maximum of 30 bytes—in practice this is 30 characters unless you are using multi-byte character set.
Let's bust out the 8 tracks, grandpa!!!
 
8:20 PM
If I For Each my way through a Collection, I can get the Item property, but not the Key property, is that correct? I'm not seeing any way to get the key back out.
 
Yeah
the Key is WO
You'd need to use Scripting.Dictionary instead.
 
carp. there goes that idear
for some reason, I was thinking that Collection was prefereable to Dictionary, but I guess #ItDepends
 
Ancedotally, I've heard that Scripting.Dictionary is usually the better choice over VBA.Collection; only reason to use VBA.Collection is to avoid having an external reference (late or early)
 
hrm. guess I had that bass awkwards...
not the first time...
 
8:35 PM
Good point aWRT external reference. The compute nodes complained about it.
 
@Freeman A scripting dictionary returns the key in a For Each loop so that you can do .Item(key). What you can't do is to provide the value and get the key back. For that I wrote a VBA class in C# (my Kvp) class. Happy to share the C# code if helps.
 
thanks. I'm using a simple For...Next loop. That's sufficient for my needs.
well... at least for now.
 
9:03 PM
@this - you were right. didn't take nearly as much time as I feared it would.
Initial testing looks good. will do more in the am, then push to production.
 
...it's only data....🎵
Glad to hear!
 
 
1 hour later…
10:19 PM
do you guys know how to pull the current paper size of a label printer?
i have printers that allow 3"x2" and 1.5"x1" on the same printer
but, depending on where it is, it could be set one way or the other
i tried looking into winapi to do it
but i crashed access out completely
 
10:51 PM
 

« first day (1958 days earlier)      last day (1222 days later) »