Hi All,

I will try and solve other peoples queries I promise, people just beat me to the ones I can do!

I am writing a code, which is quite lengthy so won't post the unnecessary sections, and one of the things it should be doing is opening up a specific file from the server, inputting a bunch of information and then closing the file. This in itself is working just fine, however the file has a password on it (password only to open, not modify) however if two people use the script at the same time it opens the dialogue box for the password.

I have tried a few iterations of different codes which would check for whether it is a read only file but they didn't seem to avoid this password problem. Has anyone encountered this before and know a way around it?

'the code below is for the automatic data capture to save Gary the trouble.
    'Data_Dump_Filepath = Sheet37.Range("D33").Value
   'delete this if statement for full roll out.
   'If user = "Tester1" Then
   
    'Workbooks.Open filename:=Data_Dump_Filepath, Password:="Password"
    'Workbooks("Data").Activate
     '   If ActiveWorkbook.ReadOnly Then
      '  Workbooks("Data").Close savechanges:=False
      ' Application.Wait (Now() + TimeValue("00:00:02"))
      '  Save_Attempts = Save_Attempts + 1
      '      If Save_Attempts = 10 Then
      '      GoTo end_of_save
   '         End If
   '
   '     GoTo Check_Open
    '    End If
        
   ' ActiveWorkbook.Worksheets("Sheet1").Range("A1").End(xlDown).Offset(1, 0).Value = "Information here by " & Environ("Username")
   '     Workbooks("Data").Close savechanges:=True
    End If
    'Else
    'do nothing but delete the Else above here and the end if after testing
     '   End If
It is currently in testing phase so commented out of the active code. The idea being that the user would not be impeded in their use by having this new spread sheet open, input the information and then close.

As you can see I have tried to check for 'read only' and for it to wait 2 seconds before trying again, for a maximum of 10 times, however it gives the password box for some reason .

Any help or guidance is appreciated.

Thanks
Maudise