Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

"hidden" text on VBA modules?

Status
Not open for further replies.

TomBarsh

Structural
Jun 20, 2002
1,003
Is it possible to "hide" the text on a VBA module in Excel?

Reason I ask is I was given a very complex (publicly distributed) workbook about "Topic A". There are a number of modules, mostly of very simple code and about half or more of which have no text at all. I tried Ctrl + End to go to the end of the document, works on 'full' modules but gets nowhere on the empty modules.

I'm thinking this is just lack of housekeeping to retain empty modules. Or is there some secret to hidden text that I don't know about?

The level of good housekeeping sometimes influences my overall confidence level. : - )
 
Replies continue below

Recommended for you

If you're looking for PROCEDURES in a module, why not the Procedure drop down on the upper-right?

Simple TEXT will not compile, using the Debug > Compile VBAProject.

The only other TEXT to search for is [highlight #FCE94F]'[/highlight]

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
I don't think so.

VBA editor appears to have no options at all with regard to fonts.

The End of nothing is nothing.
 
I've seen workbooks with scores of modules, often with one procedure per module.

If you are recording macros, this is what usually happens.

It is a good practice to add/delete, name and organize modules appropriately to contain procedures of some commonality. Often you'll just need only one module containing all your procedures.

Some module names that I might have are: DataAcquisition, ChartProcs, Utilities, DataAnalysis, BOM_DrillDown.



Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
"If you're looking for PROCEDURES in a module, why not the Procedure drop down on the upper-right?

Simple TEXT will not compile, using the Debug > Compile VBAProject."

I really didn't care what was on/in the seemingly empty modules. comments. user defined worksheet functions. VBA subroutines. VBA functions. I didn't care, I just wanted to know if there was "something" there. Thanks for the help.
 
If there are Procedures, there's sumpin!

If there's a compile error, there's sumpin!

If there's 'comment, there's sumpin!

Otherwise ain't nutin!

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
so, there was no "there" there.

like I said. "housekeeping"
 
It is not necessary to have the code in a module: you can also have code in the spreadsheets
 
Search for the word end in the entire project.

If there's executable code, there will be an end something.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
It used to be a simple matter to page through any binary using a 'hex editor' if you wished to change it, or Vern Buerg's 'list' if you didn't, just to see what was there.

Then storage got cheap and code size exploded, so paging through a hex dump can take considerable time. ... not to mention that the file format can make it difficult to see what's going on.

To sort of answer the OP question in a disappointing way, the complexity and size of today's binaries makes it possible to hide just about anything in a file, in a way in which the intended file reader will not detect it, or not say anything about it.

Trivial example: in the ancient MS Cardfile format, it's possible to insert a few bytes between the end of a given card and the beginning of the next card. The Cardfile app will not display or complain about the presence of that extra data.

Worse, malicious code can also be inserted and go undetected.

Nontrivial example, even more ancient: Tom Almy issued a programming challenge. I forgot whether it was in CP/M or MSDOS, but it was a small program that displayed 'Hello World' and exited normally. The challenge was to change the displayed text to anything else. The text 'Hello World' did exist in the binary, but the displayed text did not come from that string, so changing it made no difference in the program's behavior. Over the course of several weeks, I traced it through two levels of obfuscation before giving up. ... and I don't give up easily.

You are wise to be suspicious of binaries that have 'empty' parts.



Mike Halloran
Pembroke Pines, FL, USA
 
When in doubt, delete the modules and save the spreadsheet under a new name. If the spreadsheet still works, you'll know the modules didn't do anything. Note: If all of the modules are blank, odds are the spreadsheet does not contain any macros. By default, every time you "Record a New Macro" it creates a module for the new macro. And the module remains even if the macro is deleted, unless you delete the module in the VB editor.
 
Check that the font and background colour are not the same. Sort of makes text 'disappear'.

Dik
 
dik, that was on my mind too (text color same as background) but that doesn't seem possible in Excel 2007, that I can see. But I am not positive.

In any case, it's apparent to me that the creator of the spreadsheet has a lot of leftover items and inefficiencies in the workbook. Simply inserting the application commands to temporarily turn off screen updating and automatic calculation sped up routines by some incredible percentage (as from 'watching paint dry' to 'lickety split'). They were ecstatic to learn of these commands. I don't have the heart to be too critical of the project.
 
I use openoffice at home... and, I can format the fonts.

Dik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor