ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   activeworkbook and thisworkbook (https://www.excelbanter.com/excel-programming/414096-activeworkbook-thisworkbook.html)

salgud

activeworkbook and thisworkbook
 
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!

Per Jessen[_2_]

activeworkbook and thisworkbook
 
On 16 Jul., 00:08, salgud wrote:
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

Lars-Åke Aspelin[_2_]

activeworkbook and thisworkbook
 
On Tue, 15 Jul 2008 16:08:33 -0600, salgud
wrote:

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

salgud

activeworkbook and thisworkbook
 
On Tue, 15 Jul 2008 15:16:04 -0700 (PDT), Per Jessen wrote:

If ThisWorkbook.Name = ActiveWorkbook.Name Then


Got it. Thanks!


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com