VBA Identify Workbook

G

Guest

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.
 
H

Harald Staff

Hi

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

HTH. Best wishes Harald
 
P

Paulw2k

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

will give you the workbook name.
 
Top