Activation d'un hyperlien
Résolu
juraph
Messages postés
66
Date d'inscription
Statut
Membre
Dernière intervention
-
juraph Messages postés 66 Date d'inscription Statut Membre Dernière intervention -
juraph Messages postés 66 Date d'inscription Statut Membre Dernière intervention -
Bonjour à tous,
Je suis débutant en VBA pour Excel.
J'ai 2 feuilles Excel, la 1ere contient un intitulé et un hyperlien vers une cellule d'une seconde feuille.
Dans la seconde feuille, j'ai un intitulé (cellule accédée par l'hyperlien de la 1ere feuille) et au maximum 4 hyperliens vers des photos.
Tout cela fonctionne bien avec Excel 2003.
Après copie dans Excel 2007, la commande suivante:
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
donne l'erreur "Impossible d'exécuter le code en Mode arrêt"
Quelqu'un peut m'expliquer ?
Merci d'avance
Voici le code en question:
Dim actRow
Dim actCol
Dim actLien
Dim rgeA As Range, rgeB As Range, rang As Range
Dim exp As String
' Trouver la colonne avec un hyperlink
Set rgeA = ThisWorkbook.Names("Photo").RefersToRange
actCol = rgeA.Column
Set rgeA = ThisWorkbook.Names("Lien").RefersToRange
actLien = rgeA.Column
actRow = ActiveCell.Row
Set rgeA = ActiveSheet.Cells(actRow, 2)
exp = rgeA.Cells.Text
Set rgeB = rgeA.Offset(0, 3)
Do
If rgeB.Cells.Text = "" Then Exit Do
If rgeA.Cells.Text = "" Then
Else
If rgeA.Cells.Text <> exp Then Exit Do
End If
'Activer hyperlink pour se positionner sur la 1ere image
Cells(actRow, actCol).Activate
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
actRow = ActiveCell.Row
Cells(actRow, actLien).Activate
Set rang = ActiveSheet.Cells(actRow, actLien)
Do
If rang.Cells.Text = "" Then Exit Do
'Activer hyperlink pour voir l'image
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Set rang = rang.Offset(0, 1)
Loop
' passer au rang suivant
ActiveWorkbook.Sheets("Expo").Activate
Set rgeA = rgeA.Offset(1, 0)
Set rgeB = rgeA.Offset(0, 1)
actRow = rgeA.Row
Loop
Je suis débutant en VBA pour Excel.
J'ai 2 feuilles Excel, la 1ere contient un intitulé et un hyperlien vers une cellule d'une seconde feuille.
Dans la seconde feuille, j'ai un intitulé (cellule accédée par l'hyperlien de la 1ere feuille) et au maximum 4 hyperliens vers des photos.
Tout cela fonctionne bien avec Excel 2003.
Après copie dans Excel 2007, la commande suivante:
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
donne l'erreur "Impossible d'exécuter le code en Mode arrêt"
Quelqu'un peut m'expliquer ?
Merci d'avance
Voici le code en question:
Dim actRow
Dim actCol
Dim actLien
Dim rgeA As Range, rgeB As Range, rang As Range
Dim exp As String
' Trouver la colonne avec un hyperlink
Set rgeA = ThisWorkbook.Names("Photo").RefersToRange
actCol = rgeA.Column
Set rgeA = ThisWorkbook.Names("Lien").RefersToRange
actLien = rgeA.Column
actRow = ActiveCell.Row
Set rgeA = ActiveSheet.Cells(actRow, 2)
exp = rgeA.Cells.Text
Set rgeB = rgeA.Offset(0, 3)
Do
If rgeB.Cells.Text = "" Then Exit Do
If rgeA.Cells.Text = "" Then
Else
If rgeA.Cells.Text <> exp Then Exit Do
End If
'Activer hyperlink pour se positionner sur la 1ere image
Cells(actRow, actCol).Activate
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
actRow = ActiveCell.Row
Cells(actRow, actLien).Activate
Set rang = ActiveSheet.Cells(actRow, actLien)
Do
If rang.Cells.Text = "" Then Exit Do
'Activer hyperlink pour voir l'image
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Set rang = rang.Offset(0, 1)
Loop
' passer au rang suivant
ActiveWorkbook.Sheets("Expo").Activate
Set rgeA = rgeA.Offset(1, 0)
Set rgeB = rgeA.Offset(0, 1)
actRow = rgeA.Row
Loop
A voir également:
- Activation d'un hyperlien
- Clé d'activation windows 10 - Guide
- Clé activation office 2010 gratuit - Télécharger - Sécurité
- Mas activation - Accueil - Windows
- Activation office - Accueil - Bureautique
- Telecharger windows 10 gratuit avec clé d'activation - Accueil - Mise à jour
Merci pour ta réaction. Cela se produit en pas à pas et je me suis aperçu qu'il fallait arrêter ce mode avant de relancer.
Problème résolu