User defined type not recognized!

sharshra

Active Member
Joined
Mar 20, 2013
Messages
272
Office Version
  1. 365
I'm using user defined type to list few variables. One of the UDTs is not recognized!!! Pseudo code is given below. When I try to use udtxxxyyy in sub / function, it is not recognized. These are declared in general declarations section, along with other types. While other types are recognized, this one is not. Strange :rolleyes::eek:. Is there any reason under which types will be unrecognized? Or, am I missing anything?

In the module code below, when I right click on udtxxxyyy, I get the error message 'Identifier under cursor is not recognized'. It is also evident from the fact that intellisense is not working too.

Code:
'General Declarations section
Private Type xxxyyy
    strAll As String
End Type

Dim udtxxxyyy As xxxyyy

'In the Module
Private Sub AssignValues()
    udtxxxyyy.strAll="All"

End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Are you trying to use it in another module? If so it needs to be public, not private
 
Upvote 0
Hi Kyle123,
I'm using in the same module. While other types are recognized, this one is not!!! Wondering what can make a type unrecognizable. I don't see anything wrong or different from other types to make it unrecognizable. Can any watchful eyes point to anything incorrect?
 
Upvote 0
I'm afraid, I can't post the actual code since it is bound by legal agreements. However, it is not different from other types that I'm using successfully in the program. But only one type have this problem.

Is there any limitation on the number of types that can be used in a module / class module? I have totally 6 modules, including the one having problem(udtxxxyyy ).
 
Upvote 0
I'd start by checking very closely for typos. Are you using Option Explicit?
 
Upvote 0
Yes, RoryA. I'm using Option Explicit. Unfortunately, I don't see any typos!!!

What I'm seeing is that any types that I'm creating now are not recognized too. I tried with a dummy type now & I see same problem repeating. While the types created before are working well, new ones are not :eek::(:confused:. Is there any setting that would have made this change?
 
Upvote 0
Are you looking for the definition of udtxxxyyy or of xxxyyy? The latter would always give that message in my experience.
 
Upvote 0
I restarted my laptop & to my pleasant surprise, type is working as expected !!!!! Not sure what caused the issue & how it was resolved with restart:confused:. I'm so much relieved that it is working now :ROFLMAO:. Thanks to all who tried to share & reduce my burden. Appreciate your help. :);)
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top