Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
file sharing hitesh Excel Discussion (Misc queries) 0 May 26th 08 10:43 AM
File sharing Kelly Excel Discussion (Misc queries) 3 September 14th 05 04:50 PM
File Sharing sysop Setting up and Configuration of Excel 0 September 14th 05 09:51 AM
FILE SHARING lehigh46 Excel Worksheet Functions 1 July 6th 05 05:57 PM
SHARING MACROS VIA ADD-IN (.xla) FILE Chuckles123[_23_] Excel Programming 2 October 7th 04 08:25 AM


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"