there is a file on the server which is being worked on by another user , i want to open it in read only , copy the contents and close it back with out interferring with others works.
below is what i have done . it works but how do i open it in read only without having to notify other users.
Code
Sub Macro5()
'
' Macro5 Macro
'
Application.ScreenUpdating = False
'
'CLEAR PREVIOIUS DATA
Cells.Select
Selection.ClearContents
'
'OPEN DATABASE AND COPY ENTRIES
Workbooks.Open Filename:= _
"\\EXX-FXXX-01\CXX_EFXX$\XXL_Validation\XX_DOCUMENTATION\DataBase.xlsb"
Range("C2:DC600").Copy
'
'GO BACK TO THE MONITORING TOOL TO PASTE DATA
Windows("MonXXXng_XXX_Documentation_ExeXXse.xlsb").Activate
Range("C2").Select
ActiveSheet.Paste
'
'SORT THE DATA
Range("C2:DC600").Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("VIEW").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("VIEW").Sort.SortFields.Add Key:=Range("C4:C549"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("VIEW").Sort
.SetRange Range("C3:DC5600")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
'
'REMOVE DUPLICATES
ActiveSheet.Range("$C$3:$DC$600").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6 _
, 7, 8, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 41, 42, 43, _
44, 45, 46, 47, 48, 49, 50, 56, 57, 63, 64, 70, 71, 77, 78, 84, 85, 91, 92, 98, 99, 105), Header:= _
xlYes
'
'GO BACK TO DBASE WINDOW AND CLOSE
Windows("DataBase.xlsb").Activate
ActiveWindow.Close SaveChanges:=False
'
'SAVE MONITORING TOOL
Range("4:4").Delete
ActiveWorkbook.Save
Range("C4").Select
End Sub
Display More