bonjour à tous,
voila j'ai des liens hyper qui changent quand je travaille dans le fichier.
conséquence mes liens sont erroné
en fait quand je click sur le lien ca marche mais le lien en lui meme n'a plus la
meme adresse, et donc quand j'utilise mon userform pour récupérer le lien ca plante
le lien lu n'est pas valide.
le lien avant (fonctionne bien avec mon userform voir code dessous )
\\vls-leh-sdc01\dfs\Datateam\Qual Clients\bob\toto\2006\9270157\ 206030
Le lien aprés modification (??) ne fonctionne plus avec le code
../../../../../Datateam/Qual Clients/bob/toto/2006/9270157/ 206030
note: \\vls-leh-sdc01\dfs est le chemin d'acces du disque
voici le code
Sub Hyperlink()
UserForm1.lbllink.Visible = True
Dim Lien_hyper As String
Dim R As Range
Dim x As Byte
Dim FSO As Object
Set R = Sheets("Bdd").Cells(ligne_actuelle, 12)
x = R.Hyperlinks.Count
If x = 0 Then
'*********
'"pas de lien"
'*********
UserForm1.lbllink.Caption = "No Link"
UserForm1.lbllink.ControlTipText = "No Link defined"
Else
hyperlien_piece = R.Hyperlinks(1).Address
Set FSO = CreateObject("Scripting.FileSystemObject")
'*******************************
'"lien ok --> afficher le diapo"
'*******************************
If FSO.folderExists(hyperlien_piece) Then
afficher_diaporama_hyperlien_piece
UserForm1.lbllink.Caption = "Link"
UserForm1.lbllink.ControlTipText = hyperlien_piece
Else
'***************
'"lien incorrect"
'****************
UserForm1.lbllink.Caption = "Error Link"
UserForm1.lbllink.ControlTipText = hyperlien_piece
End If
Set FSO = Nothing
End If
End Sub
merci à tous
voila j'ai des liens hyper qui changent quand je travaille dans le fichier.
conséquence mes liens sont erroné
en fait quand je click sur le lien ca marche mais le lien en lui meme n'a plus la
meme adresse, et donc quand j'utilise mon userform pour récupérer le lien ca plante
le lien lu n'est pas valide.
le lien avant (fonctionne bien avec mon userform voir code dessous )
\\vls-leh-sdc01\dfs\Datateam\Qual Clients\bob\toto\2006\9270157\ 206030
Le lien aprés modification (??) ne fonctionne plus avec le code
../../../../../Datateam/Qual Clients/bob/toto/2006/9270157/ 206030
note: \\vls-leh-sdc01\dfs est le chemin d'acces du disque
voici le code
Sub Hyperlink()
UserForm1.lbllink.Visible = True
Dim Lien_hyper As String
Dim R As Range
Dim x As Byte
Dim FSO As Object
Set R = Sheets("Bdd").Cells(ligne_actuelle, 12)
x = R.Hyperlinks.Count
If x = 0 Then
'*********
'"pas de lien"
'*********
UserForm1.lbllink.Caption = "No Link"
UserForm1.lbllink.ControlTipText = "No Link defined"
Else
hyperlien_piece = R.Hyperlinks(1).Address
Set FSO = CreateObject("Scripting.FileSystemObject")
'*******************************
'"lien ok --> afficher le diapo"
'*******************************
If FSO.folderExists(hyperlien_piece) Then
afficher_diaporama_hyperlien_piece
UserForm1.lbllink.Caption = "Link"
UserForm1.lbllink.ControlTipText = hyperlien_piece
Else
'***************
'"lien incorrect"
'****************
UserForm1.lbllink.Caption = "Error Link"
UserForm1.lbllink.ControlTipText = hyperlien_piece
End If
Set FSO = Nothing
End If
End Sub
merci à tous