Hi all,

"Run-time error '1004' - Application-defined or object-defined error"

I get the above error message when I run a particular line of code.

The relevant section of my code is below:

Public Sub Create_Links()

    Dim lastRow As Long
    Dim cell As Range
    
    'Create hyperlinks in column B for each cell in column A starting at A238
    
    With Worksheets("Sheet1")
        lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
        For Each cell In .Range("A238:A" & lastRow)
            .Hyperlinks.Add anchor:=.Cells(cell.Row, "B"), Address:="\\Irf00377\pf-hrsc-c-shared folder\Cumbernauld Strategic Team\Change Team activities\Policy & Process\Review Folders\PPR" & cell.Value, TextToDisplay:="PPR" & cell.Value
        Next
    End With
    
End Sub
The code runs fine when the workbook is not shared but as soon as I share it the error appears.

Anyone know what I've done wrong?

Thanks