I am using the code below to make sure only the list of authorized users can access a work book. However I need to move the file "Test" to One Drive so it is accessible from laptops on the road. So I thought to change line 'location to read: "https://1234-4578-my.sharepoint.com/:t:/g/personal/edward_selkov_1234_4578_com/EZlrqxgr-dhAnryvin2jnJoBRsbrorG-Ki488h61wwdQkA?e=0cLPbH" which is the link to get the file but it does not work. how can I open the file? can anyone help?
Sub AuthorizedAccess()
Open "C:\Users\edward.selkov\Desktop\test.txt" For Input As #1 ' location
Do While Not EOF(1)
Line Input #1 , ltxt
If ltxt = "Edward Selkov" Then GoTo xit
Loop
Close
ActiveWorkbook.Close False
MsgBox "Sorry You Are Not Authorized to Access This File"
xit:
End Sub
Sub AuthorizedAccess()
Open "C:\Users\edward.selkov\Desktop\test.txt" For Input As #1 ' location
Do While Not EOF(1)
Line Input #1 , ltxt
If ltxt = "Edward Selkov" Then GoTo xit
Loop
Close
ActiveWorkbook.Close False
MsgBox "Sorry You Are Not Authorized to Access This File"
xit:
End Sub