[AccessD] VBE Experience anyone?

Shamil Salakhetdinov shamil at users.mns.ru
Fri Mar 28 14:22:02 CDT 2008


Hi Mark,

Do you meant other projects *referenced* by current MS Access application
database?

Set reference to "Microsoft Visual Basic for Application Extensibility 3.5" 
(VBIDE - usually located at C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB)

And then this code will list all the referenced ms access projects

Dim prj As VBProject
    For Each prj In VBE.VBProjects
       Debug.Print prj.Name
    Next prj

and for each project you can use your code:

    For Each prj In VBE.VBProjects
       For Each vbComp In prj.VBE.VBProjects(1).VBComponents
....

If you wanted to list/process modules in any (not only referenced) ms access
database this way (i.e. using VBIDE) then there are at least two ways to do
that:

- write COM add-in;
- start another MS Access instance from your main MS Access instance, open
external mdb in it (prevent AutoExec macro to run or start-up forms to open)
and use Automation + VBIDE...

--
Shamil
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Friday, March 28, 2008 8:53 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] VBE Experience anyone?


Hello All,
 
I am using the code below to loop through the Modules and find stuff.  It
always points to the current db.  Is there any way to point this to a
different database...if so anyone know the syntax?
 
Thanks Again,
 
Mark A. Matte
 
***************
 For Each vbComp In VBE.VBProjects(1).VBComponents        With vbComp
StartLine = 1                StartColumn = 1                EndLine =
vbComp.CodeModule.CountOfLines                EndColumn = 60
strCode = .CodeModule.Lines(1, .CodeModule.CountOfLines)
*************
_________________________________________________________________
Test your Star IQ
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_HMTAGMAR
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list