Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default VBA Identify Workbook

I need to write a macro that resides in workbook A. Using
Set fromarea = Application.InputBox("Where is the source
data?", , , , , , , 8)
fromarea.parent.name gives me the name of the worksheet
that I referenced (in another workbook). I need a way to
identify the workbook name as well. It is not
activeworkbook or thisworkbook.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default VBA Identify Workbook

Hi

It's strictly hierarchial:
fromarea.parent.parent.name
(or path or fullname or whatever WB property)

HTH. Best wishes Harald


skrev i melding
...
I need to write a macro that resides in workbook A. Using
Set fromarea = Application.InputBox("Where is the source
data?", , , , , , , 8)
fromarea.parent.name gives me the name of the worksheet
that I referenced (in another workbook). I need a way to
identify the workbook name as well. It is not
activeworkbook or thisworkbook.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default VBA Identify Workbook

fromarea.parent.parent.name Or fromarea.worksheet.parent.name

will give you the workbook name.



wrote in message
...
I need to write a macro that resides in workbook A. Using
Set fromarea = Application.InputBox("Where is the source
data?", , , , , , , 8)
fromarea.parent.name gives me the name of the worksheet
that I referenced (in another workbook). I need a way to
identify the workbook name as well. It is not
activeworkbook or thisworkbook.

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
Identify and add formula - can it be done? KP Excel Worksheet Functions 4 August 7th 06 08:02 PM
How do I identify who placed security on a workbook? Janice S. Excel Worksheet Functions 1 June 19th 06 05:42 PM
how to identify sarans Excel Worksheet Functions 7 October 26th 05 09:15 PM
Identify repeated cell entries in multiple sheet workbook as you . Trigger Excel Discussion (Misc queries) 0 August 17th 05 01:57 AM
Use of variable to identify range of sheets in a workbook rhs414 Excel Discussion (Misc queries) 1 June 20th 05 01:42 PM


All times are GMT +1. The time now is 06:44 AM.

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

About Us

"It's about Microsoft Excel"