Hi All,
I'm trying to create a Kill code to protect my workbook if an employee leaves and takes a copy of our excel file. The excel file is saved on a cloud onedrive account, so if an employee leaves I can just change the onedrive password and they won't be able to access the file any longer, however if they obviously save the file to a USB stick then I can't really stop them from going to a competitor and using it.
I just want to make Workbook Open code, that checks when excel opens whether it can connect to the Onedrive cloud URL and view the file or not. With the password changed it should fail and then I will run a kill code or even just delete random formulas so the file will look legit at first but really be useless.
Here is what I was trying to test with but since the excel file is opened from the cloud and it's larger than 5MB it's automatically opened with the desktop app and must be saving it in a local cached folder somewhere. Is there another way I could accomplish my goal? The main idea is to be able to check if it can access the cloud directory/folder or not - not necessarily to confirm if this file is located there.
I'm trying to create a Kill code to protect my workbook if an employee leaves and takes a copy of our excel file. The excel file is saved on a cloud onedrive account, so if an employee leaves I can just change the onedrive password and they won't be able to access the file any longer, however if they obviously save the file to a USB stick then I can't really stop them from going to a competitor and using it.
I just want to make Workbook Open code, that checks when excel opens whether it can connect to the Onedrive cloud URL and view the file or not. With the password changed it should fail and then I will run a kill code or even just delete random formulas so the file will look legit at first but really be useless.
Here is what I was trying to test with but since the excel file is opened from the cloud and it's larger than 5MB it's automatically opened with the desktop app and must be saving it in a local cached folder somewhere. Is there another way I could accomplish my goal? The main idea is to be able to check if it can access the cloud directory/folder or not - not necessarily to confirm if this file is located there.
VBA Code:
Dim fPath As String: fPath = "https://d.docs.live.net/f......../" 'full path hidden for this post
If ThisWorkbook.Path <> fPath Then
MsgBox "No Access found"
Else
MsgBox "Access found"
End If