How to read the file from shared PC in same work environment

Closed
ashishvb Posts 2 Registration date Wednesday July 15, 2015 Status Member Last seen July 17, 2015 - Jul 17, 2015 at 10:39 AM
Hi all can anyone please guide me on this.
I want to open the file which is stored in shred system in our work environment.
those will be accessible through run window smoothly.
But some how the workbooks.open is not able to open properly it goes into infinite loop in my coding

see the sample code below

Sub openfile()

Dim i As Integer, stng As String, lastrow As Integer
Dim var1 As Single, var2 As Single, var3 As Single, var4 As Single
Dim worksh As Integer, x As Integer
Dim path As String, wb As Workbook

Workbooks("Report.xlsm").Sheets("Final Weekly Report").Activate

lastrow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row


For i = 99 To lastrow
'If Cells(i, 1) = "WEEK 14" Then

If Cells(i, 2) = "Kumar" Then
'here shared folder ip is in * marked for security purpose
Workbooks.Open Filename:="\\*.*.*.*\8000\Delivery_1\ABC\A.1 Admin\A1.1 Time Sheets\Kumar.xlsx"

ActiveWorkbook.Close

End If
Next i

End Sub
Related: