A foreigner living in a foreign land.

I have a love/hate relationship with VBA.
I loathe it as much as I am strangely drawn to it.
It is old but it will not die, it is ugly but equally fascinating.
When I code in VBA, I feel like I discovered an old secret that begs to be understood.
I imagine ways to hack it, to ply its ancient curses into modern idioms.
Then I fail.
Then I try again.

May the god of F# have mercy on my soul and liberate me from my sisyphean plight.

http://blog.nkadesign.com

Jul
2
awarded Curious
Jun
7
comment Function to trim leading and trailing whitespace in vba
You wouldn't necessarily need to create a class if you are just using this as a normal helper functions. You can just use a Static declaration instead of a Dim for the regex inside the function itself and initialise it the first time it is used.
Jun
5
comment Function to trim leading and trailing whitespace in vba
Regex are probably not the right way to tackle this problem: they will work, but they are slow and you will end-up creating a new Regex object every time you call your Trim() function, which is probably a lot and will add lots of overhead if you use that function as you parse tokens from a text/xml file. I would go old-school on this and simple use old-fashioned string manipulation functions.
Jun
4
comment Function to trim leading and trailing whitespace in vba
Another minor nitpick, but you can use vbTab, vbCr, vbLf constants instead of 9, 10, 13. It's also slightly more efficient to use vbNullString instead of an empty "" string because that constant is already defined and the VBA engine doesn't have to reallocate a new empty string for each "" it encounters, it will re-use the one defined by the constant instead. (the VBA engine isn't as smart as VB.Net in these optimisations).
Jun
4
comment Function to trim leading and trailing whitespace in vba
This wouldn't work as the Replace() would also remove whitespace characters that are inside the string, not just at the edges of it. Additionally, there is no char() function, it's Chr() instead (or, slightly more efficient, Chr$()).
May
27
awarded Yearling
May
19
awarded Notable Question
May
14
reviewed Approve suggested edit on How to get first and last postdata from custom post type in wordpress?
May
14
reviewed Approve suggested edit on lucene.net, document boost not working
May
14
reviewed Approve suggested edit on DreamWeaver tabs (character) are not aligned
May
14
reviewed Approve suggested edit on How do I add real-time analytics to my Q or A on SO?
May
14
reviewed Approve suggested edit on What are stalled-cycles-frontend and stalled-cycles-backend in 'perf stat' result?
Apr
29
awarded Popular Question
Apr
11
comment SQL Server 2008 - Capturing all SQL Statements Hitting the Server
Not free or open source now, still it may be useful.
Apr
8
reviewed Approve suggested edit on Getting device os version in Android programmatically
Apr
8
reviewed Approve suggested edit on control Kinect motor OPENNI 2
Apr
8
reviewed Approve suggested edit on CharacterPointer in C/C++
Apr
7
reviewed Approve suggested edit on How can I add a column in sql query from nested join?
Apr
7
reviewed Approve suggested edit on Check multiples options in dependent checkboxlist C#
Apr
7
reviewed Edit suggested edit on Display image in JSP (html)
1 2 3 4 5