« first day (235 days earlier)      last day (2945 days later) » 

3:50 AM
> commit, push, pull: one small step for duck, giant leap for VBA kind
2
 
 
1 hour later…
5:15 AM
SyntaxTreeNode slaughter in progress: 86 errors in 17 files.
 
5:26 AM
78 errors in 17 files.
 
6:09 AM
70 errors in 15 files.
When I'm done, the code inspections will be powered by ANTLR :)
calling it a day for now though
 
 
8 hours later…
2:06 PM
@Phrancis Turns out the answer doesn't work.
1
Q: Sort Contacts Marked As Company

Chrismas007I found an Applescript at apple's support site to sort any contact with the "Company" checkmark checked into a "Business" group: property groupName : "Business" tell application "Contacts" if (name of groups as list) does not contain groupName then make new group at end of groups wit...

 
 
1 hour later…
3:10 PM
-2
Q: Label or Text box in VB?

AsheshLanguage: Visual Basic Question: Which Object allows you to display text? Possible Answers: Label Text Box Which is the most appropriate and correct answer for this qustion? Definition from book Label: Displays a that the user cannot modify or interact with. Text Box is a control used ...

Please kill this Q.
Separate Q:
@user3666385 You aren't going to get any love on this Q in the main site, but there are plenty of VBA programmers who would probably chat with you on our VBA chat. However, you will need to build up a little rep on Code Review before you can join so ask some questions or post some quality answers there (or earn 200 rep on SO and you'll get 100 there automatically). — Chrismas007 41 secs ago
 
"plenty of VBA programmers" is a little bit pushing it haha ;)
I think people can chat here with 20 rep anywhere on SE
2
 
@Mat'sMug Except SO chat is diff than SE chat
 
3:28 PM
I always get confused with that.. when I think I got it right a user with no CR profile shows up in the 2nd monitor and says "hi!"
 
4
Q: Tag a Chat Room with Multiple SE Parent Sites

Chrismas007This feature-request is primarily related to programming languages used in Stack Overflow, Code Review, Super User, etc. I am a heavy Stack Overflow VBA user and browse and answer VBA questions almost exclusively. For a long time as I built up my reputation, I wondered why Stack Overflow did no...

There you go @Mat'sMug ^
If you really must use buttons, a completely unnecessary workaround would be to hide a checkmark behind the button, and on-click select that checkmark and unselect any other ones. Then bring the value of the checkmark down into your quantity on click. At the end of the quantity on click Sub make sure to clear all checkmarks. — Chrismas007 10 secs ago
Completely unnecessary idea. But would be fun to program.
 
Overlapping controls can lead to unexpected issues
@Chrismas007 what would you do if you could do this?
I'll eventually use them to expose a high-level view of the VBA code, to VBA itself (through COM interop) - that will enable very cool stuff, like VBA code that can enumerate its modules' members.
can't believe that question actually got me the answer I was looking for:
-4
Q: Getting metadata in a table MySQL

Janne KycklingI need to write a query to get the metadata in a specific table and I have no idea what to do. I don't really understand what to do.

 
4:01 PM
@Mat'sMug Well the user is kind of looking to build a POS terminal where you select a ingredient button and it records the selection of the button and then activates on an amount quantity of ingredient. Does VBA have a way to highlight a command button that is "selected"
?
 
how about making its font bold and changing its backcolor?
 
@Mat'sMug True. But then you have to clear that for 20+ ingredients later... could be tedious
 
depends how object-oriented you go about it...
"worksheet database" -> these two words side-by-side in the same sentence make me shiver.
I think OP needs to first think of a design, then code it
2
 
4:31 PM
@Chrismas007 One more vote on that question and it's done.
 
what is wrong with my Formula??? ▼▼▼
 
@LynnCrumbling Thanks
 
> = B2*(1.05)
 
huh. vba has it's own room.. who'd of thought.
What app are most questions targetting?
I'd think excel, but I could see access being in close competition.
 
@LynnCrumbling a lot of VBA questions on CR are app-agnostic and also apply to VB6. Rest is mostly Excel though ;)
 
4:41 PM
@Mat'sMug Yeah. I'd imagine you could almost re-label this room vba/vb6/classic asp.
 
oooh ASP Classic... I think I've never seen a post using that ;)
 
I think the most fun that I ever had with vba was in autocad. Dynamically drawing objects based on user input.
@Mat'sMug It's scary how many classic asp apps are still out there.
 
I'm curious about how VBA works in non-Office apps. Would AutoCAD's VBA IDE (VBE?) support add-ins the way Office's VBE does?
 
@Mat'sMug It had a full-on debugger. We could step through code, mouse over variables, etc.
 
but can it be extended with IDTExtensibility?
I wonder if there would be a way to register the Rubberduck add-in and have unit tests enabled in AutoCAD VBA...
 
4:46 PM
> =PRODUCT(B2, 1.05)
Gives me 1.05, what am I doing wrong?
 
what's the value of B2? 1?
 
56689.20
 
and why not just do =B2*1.05?
 
@Mat'sMug I tried that and it gave me an error
 
interesting
 
4:47 PM
says a number used is the wrong data type
it is reading the value in B2 as a string
 
if B2 "formatted as text" you have your answer
 
even though I have it formatted as a number
 
"Format as text" is the best way to break Excel
Ctrl+1 and make it "General"
 
still the same thing
 
try =value(B2)*1.05
could your decimal separator be a comma?
 
4:50 PM
tried it both ways and with your formula and it's still broken
 
can you upload it somewhere?
try =n(B2)*1.05
 
let me try it with Microsoft cloud I haven't done that before..... or what is your Email retailcoder@ something?
 
yeah email it to me
 
@Mat'sMug that gives me 0.00
 
your number is not a number
 
4:53 PM
I bet you I copy pasted from an IE site
damn IE
@$^&$#@(%&($#)&%@(*#$)&^%$#
 
pasting into Office usually brings the encoding along
 
Delete and type it in and it works.
 
^^
glad I could help ;)
 
trying to figure out what my Salary will be if there is an annual increase in my pay of 5% it seems outrageous in 2052 I will get somewhere around $344,750 a year, if I don't get promotions and other stuff like that.
 
I didn't need to know your annual salary :)
 
4:56 PM
it's off
 
lol
 
delete that chat line
lol
I really make $344,750 a year, I work for the government.
if you know where to look you can see the pay scales, they are public
 
@Chrismas007 Tavern effect completed.
 
Only 126 to go until I can join the tavern
@LynnCrumbling Thanks
 
@Chrismas007 Eh, you can join in anytime... but yeah .. you're almost there for cv privs. Working on 5k myself.
@Chrismas007 Oh .. btw, it's 111, not 126 ;)
 
5:10 PM
@LynnCrumbling Thx
:-P
 
hahaha
 
@LynnCrumbling that shouldn't take too long ...right? (I find voting on SO is .... bleh)
 
@Mat'sMug It's hit and miss. If you've got enough answers "out there", I tend to pick up 40-50 rep a month without doing anything.
@Mat'sMug He could rep-whore the crap out of new questions and earn that in an hour if he really wanted to, though.
 
if it wasn't of rep-cap ;)
seen this?
25
A: Implementing String.Format() in VB6

Mat's MugI couldn't find one anywhere, so I made my own: Public PADDING_CHAR As String Public Function StringFormat(format_string As String, ParamArray values()) As String 'VB6 implementation of .net String.Format(), slightly customized. 'Tested with Office 2010 VBA (x64) Dim return_value As St...

my top-voted SO post - a selfie!
@LynnCrumbling oh, the 111! lol right
 
@Mat'sMug You're late to the party, but at least you got here ;)
2
@Mat'sMug Yeah, you get a +1 for this... favorited, too. Need to file that one away for later use.
 
5:15 PM
hey thanks!
there's a full-blown OOP version of it on Code Review somewhere in my old posts... waaaay overkill
but faster
actually, you might like this: github.com/retailcoder/VBTools
(the StringFormat method is in the StringType static class - but there's more VBA/VB6 goodies in there)
 
@Mat'sMug Yeah, I see that.. thanks for the link.. I'll bookmark these and take a look.
 
I need to document that shit
Especially the SqlCommand stuff... can't live without that one
 
@Mat'sMug That does look like a handy class.
 
parameterized queries with an automagic syntax - a wonder :)
Set result = SqlCommand.QuickExecute("SELECT * FROM ABC WHERE A = ?", 456)
no more concatenated strings, no more ADODB parameter setup madness!
I made the UnitOfWork+IRepository stuff last summer, when I needed to make some kind of CRUD app in VBA... and had to work offline, with no access to the database. Works like a charm, too.
I could implement a mock repository and with Rubberduck write unit tests that cover the whole CRUD functionality, without ever hitting the database... all in VBA.
(well with a little help from managed C# code)
 
6:08 PM
visual-studio usually refers to vb.net whereas vba refers to a specific ms office program using vb. Also, what have you tried so far? SO is not a code outsourcing platform. — Chrismas007 17 secs ago
I think language problem
 
VB6's IDE was also called Visual Studio... but yeah usually ;)
and VTC'd
 
6:26 PM
@LynnCrumbling I need to upload that one, too:
21
Q: Wait, is this... LINQ?

Mat's MugContext I'm working on a little project that consists in a series of Microsoft Excel add-ins (.xlam). The code being submitted for review here, is located in the Reflection project: Feel free to comment on the project architecture, but I'm mostly interested in the Reflection.LinqEnumerable cl...

Example
Dim accumulator As Delegate
Set accumulator = Delegate.Create("(work,value) => value & "" "" & work")

Debug.Print LinqEnumerable.FromList(List.Create("the", "quick", "brown", "fox")) _
.Aggregate(accumulator)
Produces this output:

fox brown quick the
(quite possibly the most creative way to revert array elements in VBA)
 
@Mat'sMug I still want to see your Tuple implementation
 
6:42 PM
@cheezsteak I think it died with my hard drive (along with the Delegate stuff)... but I can make another ;)
 
OH NOES
 
Luckily I had most of my VBA stuff on a usb key!
 
 
1 hour later…
7:55 PM
Well the webapp is down and I have cleaned out my email inbox.
 
8:32 PM
0
Q: Representing Objects as strings in VBA

cheezsteakI am working an a more meaningful way to print objects in VBA. The desired result should look something like this. Console.PrintLine List.Create(1, 2, 3) List(1, 2, 3) The concept is that objects implementing an IPrintable interface are printed as their ToString property. Primitive data type...

 
SHABAM
2
 
8:54 PM
@cheezsteak that looks pretty cool!
is cast a static class?
 
@Mat'sMug no its a standard module.
I think it should be a static class like Printable which has default methods of Iprintable objects.
 
Std module boils down to the samr thing, but yeah static class is a bit neater ;)
Did you list it or I missed it?
 
I think I just called it a module
> located in a module called cast
 
ah
I just skimmed through
fav'd though
 
Build a Tree object and you can print the set rather trivially.
 
9:43 PM
86 points later
C'mon CV privs
 

« first day (235 days earlier)      last day (2945 days later) »