Récupérer le numéro de process (PID)
Bonjour,
Je lance une instance Excel via vbs et je souhaiterai récupérer le PID est-ce possible simplement. A la suite un bref exemple - je ne trouve pas la fonction permettant de récupérer le PID!
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| Option Explicit
' xlPlatform constant declaration
Const xlMacintosh = 1
Const xlMSDOS = 3
Const xlWindows = 2
' XlTextParsingType
Const xlDelimited = 1
Const xlFixedWidth = 2
' XlTextQualifier constant declaration
Const xlTextQualifierDoubleQuote = 1
Const xlTextQualifierNone = -4142
Const xlTextQualifierSingleQuote = 2
' XlColumnDataType
Const xlDMYFormat = 4
Const xlDYMFormat = 7
Const xlEMDFormat = 10
Const xlGeneralFormat = 1
Const xlMDYFormat = 3
Const xlMYDFormat = 6
Const xlSkipColumn = 9
Const xlTextFormat = 2
Const xlYDMFormat = 8
Const xlYMDFormat = 5
' Paste operation constant declaration
Const xlPasteAll = -4104
Const xlPasteAllExceptBorders = 7
Const xlPasteColumnWidths = 8
Const xlPasteComments = -4144
Const xlPasteFormats = -4122
Const xlPasteFormulas = -4123
Const xlPasteFormulasAndNumberFormats = 11
Const xlPasteValidation = 6
Const xlPasteValues = -4163
Const xlPasteValuesAndNumberFormats = 12
' Paste Special operation constant declaration
Const xlPasteSpecialOperationAdd = 2
Const xlPasteSpecialOperationDivide = 5
Const xlPasteSpecialOperationMultiply = 4
Const xlPasteSpecialOperationNone = -4142
Const xlPasteSpecialOperationSubtract = 3
' Variables
Dim Excelobject
Dim ExcelName
Dim ExcelHInstance
Dim ExcelHwnd
'Create an Excel application
Set Excelobject = CreateObject("Excel.Application")
ExcelName = Excelobject.Name
ExcelHInstance = Excelobject.Hinstance
ExcelHwnd = Excelobject.Hwnd
Excelobject.visible = true
MsgBox(ExcelName & " - " & ExcelHInstance & " - " & ExcelHwnd) |
Merci d'avance pour votre aide!
SRoux