Code stopped adding hyperlink once again

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,748
Office Version
  1. 2007
Platform
  1. Windows
Would somebody please be willing to take a look at my code if i upload a file.

I thought i fixed the issue as its been working fine for a few days without fail but just now its stopped doing what its supposed to do.
Same issue as before without me even touching it.

I await a reply.
Many Thanks
 
Think ive spotted it.

Code:
        Unload PostageTransferSheet
        Exit Sub
        End If

Exit sub sholdnt be there
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Note that you cannot use formatting (like color coding, highlighting, italics, bold) inside of VBA code tags. If you want to use that kind of formatting, use the RICH code tags instead.
I changed the code tags in your previous post from VBA to RICH so we can see your red font selection.

So thanks for that line of code above & ive now done the following.
I see the Msgbox asking if there is a photo to hyperlink.
I select Yes, The userform closes & the customers cell is selected but thats it.
The hyperlink part doesnt work ?
Where is that section of code are you trying to set any sort of hyperlink?
You have the message box, and open the folder with images, but nowhere in that part are you attempting to set any sort of hyperlink.
VBA Code:
        If Dir(FILE_PATH & ActiveCell.Value & ".jpg") = "" Then
            If MsgBox("THERE IS NO PHOTO FOR THIS CUSTOMER" & vbNewLine & "WOULD YOU LIKE TO OPEN THE PHOTO FOLDER ?", vbYesNo + vbCritical, "HYPERLINK CUSTOMER PHOTO MESSAGE.") = vbYes Then
                CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\REMOTES ETC\DR\EBAY CUSTOMERS PHOTOS\")
            End If

        End If
You would need to add code to create the hyperlink after the photo is selected.
 
Upvote 0
Userform is open & i get to see the msgbox asking about hyperlink.
I select yes to the Msgbox & the userform closes.
The line of code you advised selects the customer in the last row at columb B
Then that code i added im now thinking it should hyperlink the customer to its photo but this doesnt happen.

That is when i put a command button on the worksheet with the code in Red.
I select the customer then press the command button & it hyperlinks no problem.
This was a test to see it my code was ok & looks ok but from the userform it doesnt work for me.

This is the code on that command button.

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"
        With ActiveCell
        .Font.Size = 12
        End With
        MsgBox "HYPERLINK WAS SUCCESSFUL.", vbInformation, "POSTAGE SHEET HYPERLINK MESSAGE"
        End If
        
        Else
        MsgBox "PLEASE SELECT A CUSTOMER FIRST TO HYPERLINK THE PHOTO.", vbCritical, "POSTAGE SHEET HYPERLINK MESSAGE"
        Exit Sub
        End If
        
        If Dir(FILE_PATH & ActiveCell.Value & ".jpg") = "" Then
        If MsgBox("THERE IS NO PHOTO FOR THIS CUSTOMER" & vbNewLine & "WOULD YOU LIKE TO OPEN THE PHOTO FOLDER ?", vbYesNo + vbCritical, "HYPERLINK CUSTOMER PHOTO MESSAGE.") = vbYes Then
        CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\REMOTES ETC\DR\EBAY CUSTOMERS PHOTOS\")
        End If

    
    End If
 
Upvote 0

Forum statistics

Threads
1,223,933
Messages
6,175,475
Members
452,646
Latest member
tudou

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top