Hyperlinks now & then dont work on worksheet

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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