Problem with Application object in VBA

Discussion created by shempen on Jan 23, 2012
Latest reply on Jan 23, 2012 by twhiteaker
I have a .mxd file with VBA programmed by a long-gone programmer.  It uses the Application object.  The code worked fine in ArcGIS 9 and in 10 until recently.  The only changes made since the move to ver. 10 were schema changes in the data tables.
First error: ???Compile error: Method or data member not found??? occurred in the bolded code below:

Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pFeatSel As IFeatureSelection
Dim pQueryFilt As IQueryFilter
Dim pSelSet As ISelectionSet
Dim pLayer As IFeatureLayer

Set pMxDoc = Application.Document
Set pMap = pMxDoc.FocusMap
Set pLayer = FindLayer("Parcels")
Set pFeatSel = pLayer

I changed Application .document to ThisDocument and it worked for that line of code, but then I got this error a few lines later:
???Compile error: Invalid use of property???  See bolded code below:

Dim pStatusBar As IStatusBar
Dim pProgbar As IStepProgressor

Set pStatusBar = Application.StatusBar
Set pProgbar = pStatusBar.ProgressBar
pProgbar.Position = 0

Any ideas?

There are no missing references.  Does the priority order of references make a difference?