ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,699
- Office Version
- 2007
- Platform
- Windows
I have a userform & the values a sent to the worksheet.
In column B will be the customers name.
The code would hyperlink this customers name if a photo was present in the advised folder & if not it would show the user a message advising no photo is present etc.
I have just seen that this no longer works.
I have a separate code on worksheet where i select the customer & add the hyperlink that way so that shows the path etc is correct.
Not sure how much of the code you need but this i believe is after the values are sent to worksheet, not sure if that shows an issue there for you ?
I have an old file where ive just tried it & it works.
There is redundant code in it that i no longer use so not sure how to go about going through it to locate the issue
In column B will be the customers name.
The code would hyperlink this customers name if a photo was present in the advised folder & if not it would show the user a message advising no photo is present etc.
I have just seen that this no longer works.
I have a separate code on worksheet where i select the customer & add the hyperlink that way so that shows the path etc is correct.
Not sure how much of the code you need but this i believe is after the values are sent to worksheet, not sure if that shows an issue there for you ?
VBA Code:
Const FILE_PATH As String = "C:\Users\Ian\Desktop\REMOTES ETC\DR\EBAY CUSTOMERS PHOTOS\"
If ActiveCell.Column = Columns("B").Column Then
If Len(Dir(FILE_PATH & ActiveCell.Value & ".jpg")) Then
ActiveCell.Hyperlinks.Add Anchor:=ActiveCell, Address:=FILE_PATH & ActiveCell.Value & ".jpg"
MsgBox "CUSTOMER PHOTO HYPERLINK WAS SUCCESSFUL.", vbInformation, "SUCCESSFUL HYPERLINK MESSAGE"
End If
Else
MsgBox "PLEASE SELECT A CUSTOMER FIRST TO HYPERLINK THE PHOTO.", vbCritical, "HYPERLINK ERROR MESSAGE"
Exit Sub
End If
If Dir(FILE_PATH & ActiveCell.Value & ".jpg") = "" Then
If MsgBox("THERE IS NO PHOTO TO HYPERLINK FOR THIS CUSTOMER" & vbCrLf & vbCrLf & _
"WOULD YOU LIKE TO OPEN THE PHOTO FOLDER ?", vbYesNo + vbInformation, "HYPERLINK MISSING PHOTO MESSAGE.") = vbYes Then
CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\REMOTES ETC\DR\EBAY CUSTOMERS PHOTOS\")
answer = MsgBox("CONTINUE TO NOW HYPERLINK THE CUSTOMER WITH PHOTO ?", vbYesNo, "HYPERLINK PHOTO MESSAGE")
If answer = vbNo Then
Exit Sub
Else
GoTo err
End If
End If
End If
End If
End Sub
I have an old file where ive just tried it & it works.
There is redundant code in it that i no longer use so not sure how to go about going through it to locate the issue