Hyperlinks now & then dont work on worksheet

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,683
Office Version
  1. 2007
Platform
  1. Windows
Morning,
ON my worksheet in column P i have invoice numbers.
These will have been hyperlinked to its invoice pdf in a folder on my pc.
Now & then like today when i click on an invoice number i see a message pop up saying CANNOT OPEN THE SPECFIED FILE.

I have looked at the hyperlink when broken & i see this.
.\..\..\AppData\Roaming\Microsoft\Excel\DR%20COPY%20INVOICES\24.pdf

I then apply the hyperlink to it so its then working again & then i see this.
C:\Users\Ian\Desktop\REMOTES ETC\DR\DR COPY INVOICES\24.pdf

Now i have at least 150 plus that are broken so is there a way to do a batch hyperlink ?

Any advise as to why this is also happening.



All the invoices are in the path shown below.
C:\Users\Ian\Desktop\REMOTES ETC\DR\DR COPY INVOICES

Then its just 1.pdf 2.pdf 3.pdf etc etc

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
If it helps you i use the following code of which i select the invoice number in the cell to hyperlink it.

Maybe it can be edited to just hyperlink each cell without me having to click each one ?
Thanks

Rich (BB code):
Private Sub HyperlinkInvoiceNumber_Click()
        Const FILE_PATH As String = "C:\Users\Ian\Desktop\REMOTES ETC\DR\DR COPY INVOICES\"
    If ActiveCell.Column = Columns("P").Column Then
        If Len(Dir(FILE_PATH & ActiveCell.Value & ".pdf")) Then
            ActiveCell.Hyperlinks.Add Anchor:=ActiveCell, Address:=FILE_PATH & ActiveCell.Value & ".pdf"
            MsgBox "HYPERLINK WAS SUCCESSFUL.", vbExclamation, "HYPERLINKING THE INVOICE NUMBER"
        Else
            ActiveCell.Hyperlinks.Delete
            MsgBox (FILE_PATH & ActiveCell.Value & ".pdf" & vbNewLine & vbNewLine & "FILE IS NOT IN FOLDER SPECIFIED, PLEASE CHECK PATH IS CORRECT"), vbCritical
        End If
    Else
        MsgBox "PLEASE SELECT AN INVOICE NUMBER.", vbExclamation, "HYPERLINKING THE INVOICE NUMBER"
    End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

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