Checking what calls a workbook

A

A.for.Andy

Hello. I have been pointed in this Group's direction by another
group...

I currently use the following code to check if a workbook called
Criticals_creator is calling the one that opens and run/not run a
macro accordingly by forcing an error:


Private Sub Workbook_Open()


On Error GoTo IsClosed


If Not Workbooks("Criticals_creator") Is Nothing Then
Worksheets("RFQ").Activate
Exit Sub
End If


IsClosed:
Application.Visible = False
WIP.Show


End Sub


Unfortunately, the workbook containing "RFQ" can also be called by a
couple of VBA apps (from SolidWorks) that need to update it.
Does anybody know of a way that I can get this macro to run only if
"RFQ" is opened by a user manually? Or get it to create the same
error
to skip the macro if called from a vba app?


Kind regards


Andy
 
Top