Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
I have files (with vba) that share with some users. Is it possible to
restrict the user certain time of using that file, automatically save and close the file on the restricted time. Is it possible to know who is using the file? Thank you for your advise |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
"Anna" ha scritto nel messaggio ... I have files (with vba) that share with some users. Is it possible to restrict the user certain time of using that file, automatically save and close the file on the restricted time. Is it possible to know who is using the file? Thank you for your advise Hello Anna, excuse-me, but i'm italian and i don't speak a good english. For the first question, i think you can use the following code: ==ThisWorkbook- Event Workbook_open== Private Sub Workbook_Open() If Time = #5:00:00 PM# Then ThisWorkbook.Close '===is not necessary to save. End If End Sub ==ThisWorkbook-Event SheetSelectionChange== Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Application.ScreenUpdating = False If Time = #5:00:00 PM# Then With ThisWorkbook .Save .Close End With End If Application.ScreenUpdating = True End Sub The problem is if person disable a macro when open your file. For the second question, i don't have solution. I hope to you it are useful. Regads Thunder |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
to see who has the workbook open at any particular time click tools share workbook , this will show you the usernames of people who hav it opened (the username is located in the tools options genera tab). Unless you ask every one to change this username manually (only need to happen once) it will probably just appear as a standard defaul username for everyone There is also a remove user option in shared workbook section (not on network can not try it) not sure if that kicks them ou -- irishboy ----------------------------------------------------------------------- irishboyx's Profile: http://www.excelforum.com/member.php...fo&userid=3249 View this thread: http://www.excelforum.com/showthread.php?threadid=52287 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
How can I restrict user to use the file for a period of time (e.g. 1 hour)
instead of close the file at a specific time (e.g. 5:00 pm) Thunder, Thank you for your help. Your code assists me force user to close file. That's great. "Anna" wrote: I have files (with vba) that share with some users. Is it possible to restrict the user certain time of using that file, automatically save and close the file on the restricted time. Is it possible to know who is using the file? Thank you for your advise |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
Anna
In the WB_Open event you could: Application.OnTime DateAdd("h", 1, Now()), TimeToClose Personally I would find this very annoying, so I hope you have a good reason for doing so. Make sure you give the user warning what is going to happen, so they chance to finish whatever they are doing. NickHK "Anna" wrote in message ... How can I restrict user to use the file for a period of time (e.g. 1 hour) instead of close the file at a specific time (e.g. 5:00 pm) Thunder, Thank you for your help. Your code assists me force user to close file. That's great. "Anna" wrote: I have files (with vba) that share with some users. Is it possible to restrict the user certain time of using that file, automatically save and close the file on the restricted time. Is it possible to know who is using the file? Thank you for your advise |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
file sharing
Nick,
Thank you for your reply. I got a runtime error when I use below coding. Run-time error €˜1004; Method €˜OnTime of object_application failed !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! Anna "NickHK" wrote: Anna In the WB_Open event you could: Application.OnTime DateAdd("h", 1, Now()), TimeToClose Personally I would find this very annoying, so I hope you have a good reason for doing so. Make sure you give the user warning what is going to happen, so they chance to finish whatever they are doing. NickHK "Anna" wrote in message ... How can I restrict user to use the file for a period of time (e.g. 1 hour) instead of close the file at a specific time (e.g. 5:00 pm) Thunder, Thank you for your help. Your code assists me force user to close file. That's great. "Anna" wrote: I have files (with vba) that share with some users. Is it possible to restrict the user certain time of using that file, automatically save and close the file on the restricted time. Is it possible to know who is using the file? Thank you for your advise |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file sharing | Excel Discussion (Misc queries) | |||
File sharing | Excel Discussion (Misc queries) | |||
File Sharing | Setting up and Configuration of Excel | |||
FILE SHARING | Excel Worksheet Functions | |||
SHARING MACROS VIA ADD-IN (.xla) FILE | Excel Programming |