View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E[_2_] AA2e72E[_2_] is offline
external usenet poster
 
Posts: 93
Default Obtain a Process ID

Excel 2000 and below do not have the hwnd property so it is necessaryto find the Window handle by other means

You can't use "Microsoft Excel" with FindWindow (the caption is volatile). Instead use the Excel class, XLMAIN. This applies to ALL versions of Excel

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Lon

The class name is lpClassName, the caption is lpWindowName. Usually, just one or the other is specified.