Bonjour,
bon bin tout est dans le titre j'aimerai réussir à éxécuter une macro word depuis excel, voila ce que j'ai j'ai sous excel :
Dim objWord As Variant, appli As Variant
Dim Fichier As String, Reponse As String
msg = MsgBox("selectionner la position des tables dans l'ordre de leurs selection" & (Chr(10)) & "" & (Chr(10)) & "1 - weight" & (Chr(10)) & "2 - reliabilty maintainability (DMC)" & (Chr(10)) & "3 - make or buy" & (Chr(10)) & "4 - Coponent Costs" & (Chr(10)) & "5 - RC Costs" & (Chr(10)) & "6 - Total NRC & System", 48)
Fichier = Application.GetOpenFilename(filefilter:=" fichiers Word (*.doc), *.doc ", Title:=" selection de la feuille PQP proposition où stocker les tables ")
Set appli = CreateObject("Word.Application")
Set objWord = appli.Documents.Open(Fichier)
appli.Visible = True
If weight = True Then
msg = appli.Application.Run(MacroName:="msg_w")
MsgBox "c'est bon pour la table 'weight' ?"
pos_w = appli.Application.Run(MacroName:="Capture_w")
Range("c12") = pos_w
End If
pour la macro capture _w ca va mais c'est pour l'autre :
Public Sub msg_w()
Application.Visible = True
ThisDocument.Activate
Set wshshell = CreateObject("WScript.Shell")
madurée = 2 '2 secondes
wshshell.Popup "selectionne l'emplacement de la table weight", madurée, "weight"
End Sub
en fait je voudrais que la popup n'apparaisse que sous word mais elle apparait sous excel et je voudrais que la feuille word s'active automatiquement quand on lance l'application msg_w.
Merci pour votre aide
Configuration: Windows 2000
Internet Explorer 6.0