W
Walter Briscoe
In message <[email protected]> of Tue, 16 Aug 2011
11:59:52 in microsoft.public.excel.programming, Martin Brown <|||newspam
|||@nezumi.demon.co.uk> writes
[snip]
Thank you for your efforts. In principle, it could be used to reference
a lists of known member names in known types. The effort of generating
such lists is more than I am prepared to do.
[snip]
I am sorry I don't know what you are talking about.
CCI is an acronym for many terms in Wikipedia.
11:59:52 in microsoft.public.excel.programming, Martin Brown <|||newspam
|||@nezumi.demon.co.uk> writes
In message said:Walter Briscoe pretended :
[snip]
I have two known unsatisfied needs for Excel:
1) A means of dumping VBA variables TO A TEXT FILE. (I have lots of
tools which handle text files.) Visual Basic Editor's View/Locals window
shows the information I want, but not in a convenient format. Ctrl-A and
Ctrl-C support would probably give me much of what I want;
[snip]
Thank you for your efforts. In principle, it could be used to reference
a lists of known member names in known types. The effort of generating
such lists is more than I am prepared to do.
TypeName(sAddIdent) might be useful hereI don't know of a way to probe the list of names that a given object
supports from VBA, but you can try all names and then output the ones
that have sensible non null values. I think it will drive you mad, to
do this, but the following code will do pretty much what you ask for.
It obviously needs refinements - it just gives the internal numeric
code of VarType() rather than indexing into an array of type names.
The code below is just a proof of concept using error trapping to allow
attempts to fetch non existent fields from an object. Obviously a full
version would read the whole range of possible fields into a array of
variants and then display only the ones that are not empty/null.
Sub Test(o As Object)
On Error Resume Next
sAddIdent = o.Addident
sAllowEdit = o.AllowEdit
sColumn = o.Column
sCountLarge = o.CountLarge
sFormula = o.Formula
sFormulaR1C1 = o.FormulaR1C1
sLeft = o.Left
Debug.Print aAddIdent, VarType(sAddIdent)
[snip]
BTW: Is there any interest in a McCabe CCI metric generator for finding
maintenance hotspots in inherited VBA code?
I am sorry I don't know what you are talking about.
CCI is an acronym for many terms in Wikipedia.