ThisWorkbook.Name returns a wrong workbook name

  • Follow


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.
0
Reply NoSpam 5/14/2010 6:20:09 AM

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

<NoSpam@aol.com> skrev i meddelelsen 
news:0sqpu59qvar159eojdabrublhthpvud39j@4ax.com...
> 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. 

0
Reply Per 5/14/2010 6:50:01 AM


1 Replies
328 Views

(page loaded in 0.047 seconds)

Similiar Articles:
















7/27/2012 9:38:42 AM


Reply: