**Rubberduck version information** Rubberduck version [2.4.1.4627] Operating System: [Microsoft Windows NT 10.0.17763.0 x64] Host Product: [Microsoft Office x64] Host Version: [16.0.11328.20368] Host Executable: [EXCEL.EXE]
**Description** I created a macro-enabled spreadsheet with simple buttons that run particular macros when clicked on. I am trying to add unit tests to these functions I wrote. To do so, I added one function at a time to a n
> I am trying to use Rubberduck to write unit tests for Excel VBA code, and I will eventually need to connect those tests to Travis CI. I was wondering if Rubberduck can run headless.
Thank you very much!
P.S. I tried emailing this question, but delivery keeps failing to contact@rubberduckvba.com.
So long as there is an existing office installation Rubberduck theoretically could be run headless. Note that there is no existing support for that usecase implemented here.
If my leaky memory serves, this already came up two or three years back. A look at the forks that are actively diverging from the mainline might be useful as I recall there was at least one fork that added headless capabilities.
May be my question is not up to the standard for Code Review, but of upmost importance for reassessing methods used in my VBA coding . While preparing/testing answer for a SO post (thought to simplest of simplest questions) VBA cell format that contain a specific percentage value, I came to a jol...
for item, price in zip(ws.Range("BP3:BP9").Value, ws.Range("BT3:BT9").Value):
if (not item[0] == '??') and price[0] > 0:
print(str(item[0])[:-2], "{:.2f}".format(price[0]).replace(".", ","))
That's Python 3 reading data from an Excel worksheet.
@Vogel612 Yes, and since I'll be using this on 2 different machines with 2 different locales, it's going to be a heck of a lot of fun.
Next step is finding out whether the locale is stored somewhere in the COM to be accessed. I'm having a little trouble with accessing those constants so far.
I'll probably just test for it one way or another.
> > I get why the removal from the repository is necessary and thanks for figuring this out. However, please keep the number of classes that can access the removal method to a minimum. > > Moreover, please do not put upgradable locks into a method that clearly states that it evaluates in a read lock.
LOL - look at it way - reviewing a PR that's beyond the ability is a learning experience. That's why I review all PRs even if I don't actually understand them. :)
Besides, we all need the insurance against stupid boneheaded mistakes....
Just wondering - you know how xml docs only works on elements like classes or methods, but not on say, a namespace, right? How would you document things like namespace and its intended scope?
You can do it in doxygen using:
/// <summary>
/// description
/// </summary>
namespace name{};
Also, it's a good practice to declare your namespaces in a NameSpaces.cs file, and comment them only in this file.
indeed. the problem is more about how a 3rd-party tool reading the xml-doc needs to work in order to "merge" the docs across all files in a given namespace.
IMO namespace docs belong in a dev wiki though
come to think of it, xml-doc for everything belongs in a dev wiki
My main problem with keeping docs out of source code is that it is easier to fall out of sync. When it's right there next to the signature, you can see if they are wrong or not.
But that's usually not the case for documentation of namespace or something like that.
Yeah, seems that doxygen does namespace thing a bit better -- sandcastle requires a static class which I think is a bit too weird and a bit too intrusive.
If I don't yet have data in a table to test against, then I need to write test cases for my methods to prove that they work as intended. Right? This gives the added bonus that I'll have test cases for my methods so I can be sure that future changes don't break anything. And it's just the right way of doing it (writing tests, that is).
Finished my task, but QA is getting slammed with bugs due to some late changes by the architects without consulting the devs about subsequent work to clean up everything that would break.
well, that was super clear and easy in my head. Guess it wasn't so in other's heads.
If I'm writing GetPersonIDBySSN but don't yet have any persons, then I can write the code and write a bunch o'tests... yeah, I can throw an existing SSN and a non-existing SSN at it, but the method itself has to query something to see if it exists.
> Headless might possibly work for VB6, but for VBA it requires a headless install of the host application, which isn't a recommended or supported scenario - one single pop-up dialog (from Excel, from the VBE, or from the VBA code itself) would "freeze" the CI server forever! But assuming everything works and there aren't any popups and there's a macro in the host document that runs on open and tells Rubberduck to parse the project / discover all tests, run them, and then publish the results to
It feels like everywhere I turn there's something new and foreign to learn and before I can start on A, I have to have B in place, but B is new to me and relies on having C in place and that's new too...
Well, if were me, I'd definitely be thinking through that month. And likely going and talking to various foreign leaders and trying to negotiate deals and getting their concerns (especially around the Irish border issues).
I'm thinking that my best bet is to write GetPersonID(firstName, lastName, DOB, SSN) (and others like it) as a stored procedure to be called from VBA, but part of me wants to write it in VBA.
I think the "wants to write it in VBA" part comes from not having written anything beyond some simple queries in tSQL for a while...
@FreeMan so you'd rather write t-sql in a VBA string literal? .......question: how would GetPersonID yield more than a single ID for a given SSN value?
in any case, T-SQL in SSMS with syntax highlighting and shitty intellisense, is better than T-SQL in a VBA string literal, with string literal syntax highlighting and no intellisense or validation whatsoever.
In the United States, a Social Security number (SSN) is a nine-digit number issued to U.S. citizens, permanent residents, and temporary (working) residents under section 205(c)(2) of the Social Security Act, codified as 42 U.S.C. § 405(c)(2). The number is issued to an individual by the Social Security Administration, an independent agency of the United States government. Although its primary purpose is to track individuals for Social Security purposes, the Social Security number has become a de facto national identification number for taxation and other purposes.A Social Security number may be...
at very minimum, copy and paste from SSMS but that's only if you are dealing with a database that for #reasons is so locked down tight that you can only run ad hoc queries.
> The number is divided into three parts: the first three digits, known as the area number because they were formerly assigned by geographical region; the middle two digits, known as the group number; and the final four digits, known as the serial number.
one thing they should have had done was to make it easy to add digits. Say we run out of XXX-XX-XXXX; add a new 3 digits XXX-XX-XXXX-XXX, and assume everyone with XXX-XX-XXXX is now just XXX-XX-XXXX-000.
@Hosch250 you don't even have to.. the first couple bytes could be encoding country/state, and there would still be more than enough combos to barcode-ID everyone on Earth for the next million years or so
which means you can take your SSN, increment the serial number by 1 and you probably have a valid SSN for some person around your age from your general area
yeah, i'm not coming up with my googling. I'm a bit uncertain because from what I understood, cryptography really changed a lot when the computers became commonplace.
Cryptography or cryptology (from Ancient Greek: κρυπτός, romanized: kryptós "hidden, secret"; and γράφειν graphein, "to write", or -λογία -logia, "study", respectively) is the practice and study of techniques for secure communication in the presence of third parties called adversaries. More generally, cryptography is about constructing and analyzing protocols that prevent third parties or the public from reading private messages; various aspects in information security such as data confidentiality, data integrity, authentication, and non-repudiation are central to modern cryptography. Moder...
back to checksums - I'm fairly sure that accountants were in habit of double-checking their books for long time before, however. I bet they came up with some way to do the equivalent.
I'm trying to write a script that will allow me to load pictures contained in my workbook into my userform dynamically in an attempt to make the workbook completely portable. I've come up with the following that seems to work but there is one line which I don't understand why it doesn't work with...
@MathieuGuindon Well... not really. I'm thinking I'll have a FindBySSN, FindByFirstLastDOBSSN4, and FindByFirstLastDOB encompassed within GetPersonID that will look based on the different combinations available (called in that order until a match is found). The question is should GetPersonID be in tSQL or VBA.
if you don't want to deal with the model/abstraction, you could return ADODB.Recordset but that means dirtier downstream code due to all the stringifying
A checksum is a small-sized datum derived from a block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. It is usually applied to an installation file after it is received from the download server. By themselves, checksums are often used to verify data integrity but are not relied upon to verify data authenticity.
The actual procedure which yields the checksum from a data input is called a checksum function or checksum algorithm. Depending on its design goals, a good checksum algorithm will usually output a significantly different...
you can have another VBA method that abstract further by calling various VBA methods to do find OR even better, call a single stored procedure that calls other stored procedures to find the result.
@this yeah, that was the dilemma I was getting at (very poorly, obviously). The FindBys being individual stored procs, being called by either a VBA method or a tSQL "manager" method.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5051?src=pr&el=h1) Report > Merging [#5051](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5051?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/ece4060b54f69e6101809c042592b5faf4d20792?src=pr&el=desc) will **decrease** coverage by `0.2%`. > The diff coverage is `46.59%`.
Is it reasonable to have a single return value from a stored proc where negative is an error code, 0 (zero) is not found and > 0 is the PK of the item being searched for. (Presumes that 0 is not a valid PK...)
ah, I see what you mean. In this case, the number is really irrelevant, it's the message that I'm after and I can put the descriptive message in the Stored Proc and just log it in VBA and be done with it.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5051?src=pr&el=h1) Report > Merging [#5051](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5051?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/ece4060b54f69e6101809c042592b5faf4d20792?src=pr&el=desc) will **decrease** coverage by `0.21%`. > The diff coverage is `45.56%`.