« first day (2008 days earlier)      last day (1172 days later) » 

12:01 AM
RELOAD!
[AndaraCodes/AdventofCode2019] 2 commits. 131 additions. 23 deletions.
[Phrancis/AdventOfCode2019] 7 commits. 361 additions. 93 deletions.
[rubberduck-vba/Rubberduck] 2 commits. 1 closed issue. 2 issue comments. 228 additions. 6 deletions.
[Minesweeper] Games Played: 126, Bombs Used: 79, Moves Performed: 16941, New Users: 13
 
 
2 hours later…
2:09 AM
0
Q: Simplify & Reduce steps in the IsDistinct function

thisBecause I often have to deal with two Variants that may or may not be Null, we need a null-safe equality test, so I came up with IsDistinct which works but I have some issues with the code: When I tried to keep it terse, the readability was harmed. When I tried to expand the logic for readabili...

 
 
6 hours later…
7:51 AM
\o hopefully a simple question.
How do I resolve Compile error : Syntax error which I get when adding code to a new standard module which has Attribute VB_Name = "JSON" as the first line. It is the attempt to set the attribute which is causing the complaint.
 
8:05 AM
Attribute statements are not legal in the code pane.
If you want to use code with attributes, you have to import it from file.
In this special case, you can just remove the attribute and set the module's name to JSON.
An alternative to handle attributes is to used Rubberduck's attribute annotation system.
It will generate inspection results whenever the attribute annotations and attributes are out of sync and allow you to fix the attribute via a quick fix.
@QHarr ^
 
8:31 AM
@QuackExchange I hope that helps. My small token repayment into to the Grand Canyon of knowledge you've helped me understand.
 
@M.Doerner Thank you
 
 
2 hours later…
10:39 AM
0
Q: Round numbers in MS Word

Máté JuhászI need to round numbers in a Word document, as I couldn't find a built-in way, here is my approach. As I use VBA mainly in Excel I'm not sure whether I've done it the best way possible: Sub RoundNumbers() Dim OrigRng As Range Dim WorkRng As Range Dim FindPattern As String Dim ...

 
 
4 hours later…
2:11 PM
Hi guys. Missing translations here.
 
2:23 PM
And very annoying thing - When description text is long and window width of Inspection is shorter, the text won't go to the new row but stays.
And the right scrollbar is "hidden". you have to vertically scroll to the right to see it.
 
 
2 hours later…
4:07 PM
monking!
In Excel, I can put =COUNTIFS(Data[Date],"<11/1/2019",Data[Rela],"Employee") in a cell to get a count of all Employees who have a Date prior to Nov 1, 2019, which is handy.
What if I want to create a named range CutoffDate and change the formula to =COUNTIFS(Data[ScreenDate],"<CutoffDate",Data[Rela],"Employee")?
That gives no error, but gives me 0 (after all, no dates are less that "CutoffDate").
 
@SonGokussj4 hm, looks like they're just the enum names... do we not have resource keys for them?
@SonGokussj4 100% agree
 
I tried =COUNTIFS(Data[ScreenDate],"<"Indirect(CutoffDate),Data[Rela],"Employee") and =COUNTIFS(Data[ScreenDate],"<"&indirect(CutoffDate),Data[Rela],"Employee"), but I'm not finding the correct incantation.
pointers?
(as in tips, not c*)
 
@FreeMan I don't understand what the problem is then
oh
ok I see it now
 
derp
=COUNTIFS(Data[ScreenDate],"<"&CutoffDate,Data[Rela],"Employee")
 
, "<" & CutoffDate works fine here
 
4:14 PM
CutoffDate is already a cell ref, so the Indirect() was extra, unnecessary work
 
I'll go back to beating my head on the wall... I learn eventually
 
@MathieuGuindon I think we should just move the scroll viewer from around the entire control to directly around the grouping grid.
 
I think so too... but then why do we need a ScrollViewer at all?
(the GroupingGrid already has scrollbars, no?)
 
5:08 PM
why do people insist on re-inventing wheels with their own homebrewn FileExists, MakeFile, GetFileName and all various file handling routines?
 
might not know what's available out there?
 
but, but... they should search first!!!
hm. but then again, they could have, came across a lame SO post with "here's the codez", copy'n'paste, profit!
and making me very annoyed in the end.
it's doubly annoying when their square wheels has quirks and they've worked around it so that using FSO or whatever standard library, no longer work.
 
@this i'm sorry, if it doesn't start with set f = application.inputbox("Input file path") then it's not a real file handler
 
hey, where do you live?
gonna stop at my nearby Home Depot before I swing by.
 
LOL
 
5:20 PM
>:D
 
howm brood coad
it can get worse!
 
lol
 
oh, @this going back like a week... yes, the cancel=true was useful for my saveas, but i forgot one very important point... application.enableevents=false at the start. with that, i could actually save, as opposed to just seeing the popups. kind of infuriating, but glad i caught it before the release
£howmbrood
...my wife just texted me about how her coworker asked if we have twins, or should i say "it's a miracle you're working at all with twins", which is kind of weird... apparently our pictures are old where each kid is ~9 months old, which is several years behind actual age lol
£CubicleLife
 
5:39 PM
I'd have shot back, "It's a miracle that you have a life at all."
BTW, what'd be a "howmbrood"?
 
@this my crapshoot at trying to redirect a saveas when saveas works
building from nothing as opposed to googling and seeing the 2 documented necessities that would have made it work in the first place
i figure that's the exact point you made to mat about people not searching
 
no i mean, what does "howmbrood" means? Not a familiar word? meme? something else?
 
oh, my bad... earlier you were talking about "homebrewed code" and I said "howm brood coad; it can get worse", so just taking that making shit up on your own thing forward
like someone saw what you said, like the word "cool," and now kids write "kewl"
 
OOOOOH, went over my head!
 
a phonetic bastardization (don't tell the dutch)
 
5:48 PM
TBH, I thought you were speaking Welsh or something!
LOL
 
the land where "acorn" means both "acorn" and "squirrel"
 
:D
so, they say "acorn eats an acorn"
 
i imagine so
"eekhoorn eet eikel" according to google, but in conversation both are "eekhorn" when talking individually
 
i can not help but read it as "eek! horn!"
 
lol, or go with the german variant: eichhörnchen ltierally meaning oak creature
eich/eek = oak
had a former coworker whose wife is from the netherlands, so he's always come in with stories about things her mother would say when she came to visit
with a great quote "it's the most awkward 3 months of my year when her mother visits... they could be sisters how similar they look, which gives me... problems"
 
6:13 PM
reliving the pain of yesteryear all at once:
10
Q: Running DOS, Windows 3, and Windows 98 from one FAT32 partition?

Brian HI'd like to setup a Windows 98 SE system that boots into the included MS-DOS 7.1 command line, and which can also run Windows 3.11. I've seen various disjointed posts online that suggest this is possible without using multiple boot partitions, and that all 3 OS's will support a large FAT32 partit...

 
@FreeMan thank goodness for the well constructed answer
 
It feels like the VBA macro recorder has a new bigger brother. Very beneficial for those that know how to set it up. However 'UI Flows enable you to intuitively automate workflows without any expertise in code development' gives me visions of horrific questions...
 
6:28 PM
and it gets worse:
If FileExists(sourcefilename) Then
    FSO.CopyFile sourcefilename, strOutputFile
    Kill sourcefilename
End If
They knew. They knew. Yet they went on using all variants of homebrewn code, VBA's crappy built-in I/O statements and FSO?
Feature request: UnholyCodeMashupInspection
 
@this Enlightenment please. What's sinful about this?
 
they defined a VBA function named FileExists, then in very next line, they used FSO.CopyFile. But... FSO (aka Scripting.FileSystemObject) has a function named FileExists. Then in next line, they used Kill, a VBA statement when the FSO also has a DeleteFile.
So they've managed to use 3 completely different ways to do file handling in only 3 lines.
 
:derp: I read that as FSO.FileExists.
 
6:49 PM
> A Scripting.FileSystemObject instance is in scope. Would you like a 2x4 in the forehead?
2
</clippy>
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
Get Hosch's approval before you start using his shtick.
 
Pretty sure he'd
 
@IvenBach Approval granted.
 
i'm having a moment of stupidity...
dst.range(dst.cells(1,1),dst.cells(10,1)).value = Evaluate(src.range(src.cells(1,1),src.cells(10,1)).value/2)
that should divide the entire source (src) range by 2, then put all into the desired destination (dst) range?
 
6:58 PM
I think that'll do that for just the first cell and populate that into all cells.
 
...just realized what i did wrong with evaluate()... Evaluate(src.range(src.cells(1,1),src.cells(10,1)).value & "/2")
 
I accidentally hit the Help button on an Excel notification. This is what it told me:
 
it only handles strings
 
er, need "address" not ".value" too
 
7:01 PM
funny, I seem to be online...
 
@FreeMan nope, you aren't. Microsoft's always right.
 
either that or my browser has a phenomenal AI posting stuff in chat.
 
is your account logged in? only time i've seen that
 
@FreeMan We're just figments of your imagination. You're actually passed out drooling on your keyboard.
 
discreetly contacts Microsoft thought police
 
7:01 PM
account? I don't need no stinkin' account!
@this I get plenty of that from the media, don't need it here, too. :(
 
@FreeMan alt.text: "Windows could not find IE6, therefore there's no Internet."
 
@Cyril Nifty lil' trick you found.
 
@MathieuGuindon AFAIU, the problem with the grouping grid's internal horizontal scrollviewer is that it acts strangely when you expand and collapse groups.
 
Have you tested with large ranges? Is it more performant than using a factor cell (factorCell.Value2 = 2; destination.Value2 = source.Value2; factorCell.Copy; destination.PasteSpecial xlPasteValues, xlPasteSpecialOperationDivide)?
 
7:19 PM
@M.Doerner hm. well, considering the GroupingGrid seems to behave nicely now, presumably just wrapping the control (just the control) with a ScrollViewer would still behave nicely, without wrecking the rest of the toolwindow
worth a shot :)
 
@IvenBach ; is for C# while : is for VBA. The languages are blurring.
 
@MathieuGuindon that explains so much!
 
7:35 PM
anyone know how you step through a userform's commandbutton to test? can't do it when the form is open
oh, apparently you have to click the buttons to keep the step through going... /wrists
 
if you had a Model-View-Presenter you wouldn't be testing userform's commandbuttons' click handlers
 
@MathieuGuindon what?
 
testing commandbutton click handlers means your click handlers are doing stuff that needs testing, no?
just saying, stuff that needs testing should not be in a click handler :)
 
for the "stepping through" part specifically, you're using breakpoints, right?
(debugging is a separate problem from writing testable code, BTW)
 
8:02 PM
<-- no idea for either of your statements
@MathieuGuindon that part i can follow; not sure what the model-view-presenter is... sorry for not being more clear
@this i've heard the term... not really sure what to do with it
 
Model-View-Presenter (MVP) is a UI design pattern I've blogged wee bit about
 
do you see the grey bar on the left?
(to the code pane, I mean)
click on it, and a red dot should appear
that's your breakpoint.
put it on the line that's start of your command click event
then click on it, and you will be able to step through
I highly recommend that you do read Mat's blog... [UserForm1.Show.
 
@MathieuGuindon will take a look
 
@MathieuGuindon fyi the SEO is abysmal. It took me several google searches to actually find that article
not even the userform1.show site:rubberduckvba.wordpress.com worked
 
I suck at tagging
I used to do "rubberduck userform1.show" before I bookmarked it
 
8:12 PM
hmm, no, that's not Google. That's DDG
Google did get it on first hit. DDG, nowhere. I had to go to a random page and pick off a link from there
:-(
thinks the time to move to a mountain cabin is really near
 
@MathieuGuindon - I left my comment knowing you'd have a better explanation... — Tim Williams 1 min ago
hm, not sure if I should be reading snark in there
love Chip Pearson (RIP), but his wording on "objects are passed by reference" is harmful
 
Thanks, @this for the link
 
@MathieuGuindon I've bookmarked so many of your pages without giving each a decent description I still have trouble finding them. Maybe a summary page that holds links to the external files and companion links to the articles. Some of the external files are in the comments section which makes it even harder.
 
I need to spend a good weekend just cleaning up the blog. Should probably do that this week, kind of prep for v2.5
A proper TOC page is in order =)
 
8:52 PM
@MathieuGuindon - that would be a weekend well spent for us consumers of your blog, but do you have the time?... LOL. I know I have gained a lot from your blog and have pointed countless others to it. I had no idea how awful my coding has been. I am reforming and repenting <G>
 
I don't know. I'll make the time :)
 
9:18 PM
@Cyril FYI F9 is the hotkey for setting breakpoints in the IDE.
^^ Take 15 mins of my Saturday. You need them more than I do.
 
9:34 PM
0
Q: Add items to Dictionary from another dictionary on cell value change

Zack EI have created a very simple Class Module and a Dictionary to store original values when the workbook is opened as part of this project ive been working on. When the workbook opens I call a test to see if its open in read only mode because multiple people will be in the workbook, but only one pe...

 

« first day (2008 days earlier)      last day (1172 days later) »