Re : Lien Hypertexte vers word
Bonsoir,
J'ai privilégié l'emploi de labels plutôt que des liens hypertextes :
Ne pas oublier d'activer les références
- Microsoft Excel XXX Object Library dans Word
- Microsoft Word XXX Object Library dans Excel
et d'activer les macros dans Word
Dans ton doc Word, insères un label avec le nom de ton fichier excel, sans l'extension (Propriété/Caption), puis insères ce code:
Private Sub Label1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim appXl As Excel.Application
Dim Wb As Excel.Workbook
Set appXl = CreateObject("Excel.Application")
appXl.Visible = True
Set Wb = appXl.Workbooks.Open("C:\le chemin d'accès à ton fichier\" & Label1 & ".xls")
Sheets("la feuille que tu veux activer").Activate
End Sub
Dans ta feuille Excel, insères un label avec le nom de ton fichier excel, sans l'extension (Propriété/Caption), puis insères ce code:
Private Sub Label1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim wdApp As New Word.Application
Dim wdDoc As Word.Document
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open("C:\Le chemin d'accès à ton fichier\" & Label1 & ".doc")
ActiveDocument.Bookmarks("Le nom de ton signet").Select
End Sub
En double clickant sur les labels, tu ouvriras les fichiers respectifs.
Tu peux bien sûr affecter ces macros à d'autres contrôles.
A+
kjin