specific compile error

Robby87

Board Regular
Joined
May 9, 2008
Messages
128
I get the following error when I run my code:

"Compile error:
User-defined type not defined"

VBA highlights this line of code:
Public msg As New TibrvMsg

I think maybe I'm missing a reference or something in tools/references.

Any recommendations?

Thanks!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
TibrvMsg isn't recognised in VBA as far as I am aware. What are you trying to do?
 
Upvote 0
I'm editing a macro written by someone else, and I also don't understand what that particular line of code does, but it produces an error that solves the problem.

The only line of code in which the variable again appears is this:
If Not msg.IsValid Then msg.create Else msg.Reset

That statement is in a for...next loop.

Any ideas? I'm thinking there is a quick fix for this because I believe the code runs on other peoples computers.
 
Upvote 0
Go to one of the computers on which this works and verify what references they have set. That should identify if there is one you do not have.
 
Upvote 0
Take a look under Tools>References...

Is anything marked as MISSING or is there anything with a similar name to TibrvMsg?

All that line of code does is (try to) declare a variable of the type TibrvMsg.

What is the purpose of the code?

Is it using anything outwith Excel? eg ORACLE, Java?
 
Upvote 0
thanks -- problem resolved.

In order to resolve an earlier problem in the code, I unchecked the missing reference. I looked at an earlier version of the code, found out which reference was missing, and just checked it off in reference.

That solved the problem. much appreciated everyone.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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