Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA has "lost" some datatypes
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 a 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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA has "lost" some datatypes
These items are defined in the Office type library. It sounds like you have
lost your reference to that library. In Tools=References in the VBE, make sure now libraries are shown as missing and create a reference to the office type library. -- Regards, Tom Ogilvy "MWE" wrote in message ... 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 a 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA has "lost" some datatypes
Thanks; your analysis was correct. Any thoughts on how
the box for this library became "unchecked"? -----Original Message----- These items are defined in the Office type library. It sounds like you have lost your reference to that library. In Tools=References in the VBE, make sure now libraries are shown as missing and create a reference to the office type library. -- Regards, Tom Ogilvy "MWE" wrote in message ... 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 a 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. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA has "lost" some datatypes
No, not really.
-- Regards, Tom Ogilvy wrote in message ... Thanks; your analysis was correct. Any thoughts on how the box for this library became "unchecked"? -----Original Message----- These items are defined in the Office type library. It sounds like you have lost your reference to that library. In Tools=References in the VBE, make sure now libraries are shown as missing and create a reference to the office type library. -- Regards, Tom Ogilvy "MWE" wrote in message ... 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 a 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. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |