Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"