KeithGargett
New Member
- Joined
- Sep 2, 2019
- Messages
- 6
Hi,
I have the following piece of code running when opening a workbook.
I want this workbook to be shared, but when I open in shared mode this piece of code gives me a run-time error '1004': Application-defined or object-defined error.
Works fine when not in shared mode. I have googled specific error number but cant work out which bit is causing the error.
[/FONT][/COLOR][/LEFT]
I have the following piece of code running when opening a workbook.
I want this workbook to be shared, but when I open in shared mode this piece of code gives me a run-time error '1004': Application-defined or object-defined error.
Works fine when not in shared mode. I have googled specific error number but cant work out which bit is causing the error.
Code:
Private Sub Workbook_Open()
Range("A7").Activate
Dim cnf
Dim dir As String
Dim fnsh As Long
Dim i As Long
Set cnf = CreateObject("Scripting.FileSystemObject")
fnsh = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row - 2
Application.ScreenUpdating = False
For i = 7 To fnsh
dir = ActiveWorkbook.Path & "\Draughting Requests\" & Cells(i, 1).Value
Range("A" & i).Hyperlinks.Delete
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), Address:=dir
Next
Set cnf = Nothing
Application.ScreenUpdating = True
End Sub
[LEFT][COLOR=#222222][FONT=Verdana]