Error on Dim statement (Office 2007)

L

Lurfys Maw

Several years ago, Jay Freedman helped me and another poster write a
macro to randomly assign different colors to each letter in a
selection of text. The macro worked beautifully the last time I used
it, 4-5 years ago. I just tried it again and I got an error on this
Dim statement:

Dim obForm As frmCharColors
Set obForm = New frmCharColors

The error is a compile error:

User-defined type not defined

I never really understood what this was doing. Can someone help me
understand this or at least fix it?

I don't believe I changed it since it worked, but I could be wrong
about that. It's been a long time. I have upgraded from Office 2000 to
Office 2007 since then.

PS: I mistakenly posted this over on the Newusers group. Sorry for the
double post.
 
R

Rochelle Fisher

The macro language / syntax changes between versions. I think that
from 2003 to 2007, you are OK. But I've seen this error from 2003 to
2010. So I guess you have to upgrade 2000 macros for 2007 syntax.
 
T

Tony Jollans

Are you running this in the same document as before, or have you copied the code, perhaps without copying the UserForm (called frmCharColors) that goes with it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top