activeworkbook and thisworkbook

S

salgud

At the beginning of a macro I'm writing, I'm trying to test to make sure
that the activeworkbook is not the one the macro is in. I put this line in:

If ActiveWorkbook = ThisWorkbook Then

followed by a message box to the user. But I'm getting an "Object doesn't
support this property or method" error on this line. How do I text this
correctly?
Thanks again!
 
P

Per Jessen

At the beginning of a macro I'm writing, I'm trying to test to make sure
that the activeworkbook is not the one the macro is in. I put this line in:

If ActiveWorkbook = ThisWorkbook Then

followed by a message box to the user. But I'm getting an "Object doesn't
support this property or method" error on this line. How do I text this
correctly?
Thanks again!

Hi

Try this:

If ThisWorkbook.Name = ActiveWorkbook.Name Then

Regards,
Per
 
L

Lars-Åke Aspelin

At the beginning of a macro I'm writing, I'm trying to test to make sure
that the activeworkbook is not the one the macro is in. I put this line in:

If ActiveWorkbook = ThisWorkbook Then

followed by a message box to the user. But I'm getting an "Object doesn't
support this property or method" error on this line. How do I text this
correctly?
Thanks again!


Try this:

If ActiveWorkbook.Name = ThisWorkbook.Name Then

Hope this helps / Lars-Åke
 

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