Is there a way in VBA for Excel that a worksheet can identify how it was opened?
For example if I have a macro in workbook Workbook1.xls and it calls a macro in another workbook Workbook2.xls, what code/property would I write/access in a macro in Workbook2.xls that would identify that it was Workbook1.xls that opened it?
In other words
Workbook1.xls contains macro test
Sub test()
Run "Workbook2.xls!test2"
end sub
Workbook2.xls contains macro test2
Sub test2()
MsgBox("This workbook was opened by:" & ActiveWorkbook.SOMEPROPERTY)
end sub
What is the SOMEPROPERTY that would produce a string value of "Workbook1.xls"?
Thanks in advance.
For example if I have a macro in workbook Workbook1.xls and it calls a macro in another workbook Workbook2.xls, what code/property would I write/access in a macro in Workbook2.xls that would identify that it was Workbook1.xls that opened it?
In other words
Workbook1.xls contains macro test
Sub test()
Run "Workbook2.xls!test2"
end sub
Workbook2.xls contains macro test2
Sub test2()
MsgBox("This workbook was opened by:" & ActiveWorkbook.SOMEPROPERTY)
end sub
What is the SOMEPROPERTY that would produce a string value of "Workbook1.xls"?
Thanks in advance.