Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default 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!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ThisWorkbook/ActiveWorkbook John Keith[_2_] Excel Programming 2 February 8th 06 10:35 PM
Help with ThisWorkbook David Excel Programming 0 May 27th 05 09:54 PM
Help with ThisWorkbook K Dales[_2_] Excel Programming 0 May 27th 05 09:50 PM
ThisWorkbook vs. ActiveWorkbook? JK Excel Programming 5 April 19th 05 07:54 AM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"