View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default User Defined Type not Defined error

You get that error when you attempt to declare a variable of a data type
that is not defined to VBA. It might be as simple as a misspelling. E.g.,

Dim N As intger ' Note misspelling of 'Integer'

Or it might be due to a reference that should be referenced that isn't
reference, or that a type library is missing.

In VBA, go to the Tools menu and choose References. See if any of the
checked items are marked "MISSING". If this is the case, you have two
choice. Uncheck the reference item, click the Browse button, and navigate to
the actual location of the type library (it may be a *.exe, *.dll, *.ocx, or
*.tlb file). The other way to go it to cause Excel to re-register itself
with Windows, which will clear up reference problems with standard type
libraries but not necessarily with user-created libraries.

Close Excel (and any other Office program like Word or Outlook), then go to
the Windows Start menu, choose Run and enter the following and click OK

Excel.exe /unreserver

The repeat with

Excel.exe /regserver

This will cause Excel to start, rewrite all of its settings, libraries, and
references back to "factory defaults", and then quit.

Now, start Excel normally and see if the problem is still there. If so, post
the line of code that is causing the problem.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"slreilly" wrote in message
...
Every time I edit a cell I get an error message that says "User-defined
type
not defined". I am not so familiar with VBA, but I know this has something
to
do with it. Can anyone please tell me how to get rid of this?? There's no
code or macro in this workbook...

thanks!