Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default ThisWorkbook.Name returns a wrong workbook name

I am using Excel 2003 and an addin I have written. When I use
ThisWorkbook.Name in my code, it returns the name of the addin, not the
name of the workbook I have open.

How can I get the name of the workbook, not the addin?

Many thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default ThisWorkbook.Name returns a wrong workbook name

ThisWorkbook will always refer to the workbook where the macro is.

You can use ActiveWorkbook.Name to return the name of the active workbook.

Regards,
Per

skrev i meddelelsen
...
I am using Excel 2003 and an addin I have written. When I use
ThisWorkbook.Name in my code, it returns the name of the addin, not the
name of the workbook I have open.

How can I get the name of the workbook, not the addin?

Many 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.Name returns a wrong workbook name [email protected] Excel Programming 1 May 14th 10 07:43 AM
VBA Sum returns Wrong Format code_hungry Excel Programming 7 January 25th 08 11:03 PM
Row() function returns wrong row and more.. Kim Excel Worksheet Functions 5 July 11th 06 02:11 AM
SUM returns wrong result MarkN Excel Worksheet Functions 5 October 20th 05 03:59 AM
?thisworkbook.VBComponents(5).Type returns 2 [email protected][_2_] Excel Programming 1 December 13th 04 06:13 PM


All times are GMT +1. The time now is 08:21 PM.

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"