Dale Fye
asked on
Hide VBE Window when searching code modules
I'm implementing some code that will search all of the code modules (not form or report modules) to determine whether a specific function is defined in the database. The code I'm using works fine, thanks to the code posted by JDettman in this post
DoCmd.OpenModule doc.Name
command. Is there a way to keep the VBE Window hidden during this process?
Set db = CurrentDb
Set ctr = db.Containers("Modules")
For Each doc In ctr.Documents
DoCmd.OpenModule doc.Name
Set myMod = Modules(doc.Name)
Debug.Print myMod.Name
Do Until myMod.Find(OnAction, StartLine, StartColumn, EndLine, EndColumn) = False
If myMod.Find("Function", StartLine, 0, StartLine + 1, 0) Then
bFound = True
ElseIf myMod.Find("Sub", StartLine, 0, StartLine + 1, 0) Then
bFound = True
Else
StartLine = EndLine
StartColumn = EndColumn
EndLine = Empty
EndColumn = Empty
End If
If bFound Then Exit For
Loop
Next
IsValidFunction = bFound
but opens the VBE window as soon as it hits the firstDoCmd.OpenModule doc.Name
command. Is there a way to keep the VBE Window hidden during this process?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When Rick's F&R searches modules, the VBE window does flash ...
ASKER
Yeah, neither of those worked, just generated errors. I think you are right, if Rick hasn't figure it out, what makes me think that I would be able to in this short a period of time.
Check your mail, sending you another version
Check your mail, sending you another version
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Joe,
Tried that one too. You cannot search the modules unless you first open the module (tried and didn't work) and that line generates an error if the VBE.MainWindow.Visible = False, at least it did on 2007.
This really isn't critical, since developers are going to normally be in design view when creating the shortcut menus, anyway. I just didn't like the visual of all those windows opening in the VBE.
Tried that one too. You cannot search the modules unless you first open the module (tried and didn't work) and that line generates an error if the VBE.MainWindow.Visible = False, at least it did on 2007.
This really isn't critical, since developers are going to normally be in design view when creating the shortcut menus, anyway. I just didn't like the visual of all those windows opening in the VBE.
I see.
I was able to install Add In here at work ... messing with it now.
I was able to install Add In here at work ... messing with it now.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Jim ... he already tried MainWindow ...
mx
mx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
None of the solutions actually resolved the issue, but they pointed me in the right direction. In the end, I had to accept that what I wanted to do is not currently possible.