How can I get the process ID of the current Excel instance that my VBA code is running in? I don\'t want to asking for it by the name in the caption, which causes problems when
My solution in Excel 2013: in a new module, I added the following code:
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long Public Sub Test() Debug.Print GetCurrentProcessId End Sub