M
MWE
I am running Excel2000 under WindowsXP. I have dozens of
Excel applications with VBA. Suddenly, they are all
failing with various "data type not defined" errors. VBA
seems to have lost its understanding of some datatypes it
is supposed to support. For example, a general menu
building subroutine that has been running flawlessly for
several years uses several standard datatypes; relevant
DIM statements are:
Dim HelpMenu As CommandBarControl
Dim NewMenu As CommandBarPopup
Dim MenuData As String
When this routine is called, the first statement now fails
with a reference to an undefined user-defined Type. To me
this means that VBA thinks CommandBarControl is a user
defined type and not a standard type.
If I comment out the first Dim statement and run the
routine again, if fails with the same error message now on
the 2nd line. If I comment out the 1st and 2nd lines, the
routine runs (it understands the String datatype) until it
fails because the HelpMenu and NewMenu objects are not
understood.
I reinstalled Excel but the problem persists.
Any help would be greatly appreciated.
Excel applications with VBA. Suddenly, they are all
failing with various "data type not defined" errors. VBA
seems to have lost its understanding of some datatypes it
is supposed to support. For example, a general menu
building subroutine that has been running flawlessly for
several years uses several standard datatypes; relevant
DIM statements are:
Dim HelpMenu As CommandBarControl
Dim NewMenu As CommandBarPopup
Dim MenuData As String
When this routine is called, the first statement now fails
with a reference to an undefined user-defined Type. To me
this means that VBA thinks CommandBarControl is a user
defined type and not a standard type.
If I comment out the first Dim statement and run the
routine again, if fails with the same error message now on
the 2nd line. If I comment out the 1st and 2nd lines, the
routine runs (it understands the String datatype) until it
fails because the HelpMenu and NewMenu objects are not
understood.
I reinstalled Excel but the problem persists.
Any help would be greatly appreciated.