Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Auto Check-out / Check -in

I have a "busy" file (sharepoint hosted) that, at particulary times of the
months, many folks converge upon it to provide monthly updates of specific
worksheets.

Sometimes the clobber each other by overwritting each other, etc, because
they fail to check the file out. I would like to write some code that would
automatically check the file out immediately upon open, and the check it in,
upon close. And if I had this code, where would it be placed? Is there a
location where you can place code you want executed at open (or close)?

Thanks! Patk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Auto Check-out / Check -in

1) Set up the Document Library to require checkout on Edit.
Settings - Document Library Setting - Versioning Settings

Select Require documents to be checked out before they can be edited.

2) Train the users to EDIT the document in Microsoft Excel,Powerpoint, etc.

On my system, if I open a document and don't check it out to edit, it's
opened as READ ONLY.

Here is some code I use when I want to check out or check in a document
programmatically. I'm not sure it'll do what you want to do though, but it's
a starting point.

Sub UseCheckOut(PPTApp As PowerPoint.Application, doccheckout As String)

' Determine if workbook can be checked out.
'Test for file existance first
If FileExists(doccheckout) Then
If PPTApp.Presentations.CanCheckOut(doccheckout) = True Then
PPTApp.Presentations.CheckOut doccheckout
Else
'MsgBox "Unable to check out this document at this time."
End If
End If
End Sub

Sub CheckIn(aPPS As PowerPoint.Presentation, myComment As String)
aPPS.CheckIn SaveChanges:=msoTrue, Comments:=myComment, MakePublic:=msoFalse
End Sub

Function FileExists(fname) As Boolean
' Returns TRUE if the file exists
Dim x As String
x = Dir(fname)
If x < "" Then FileExists = True _
Else FileExists = False
End Function



--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"PatK" wrote:

I have a "busy" file (sharepoint hosted) that, at particulary times of the
months, many folks converge upon it to provide monthly updates of specific
worksheets.

Sometimes the clobber each other by overwritting each other, etc, because
they fail to check the file out. I would like to write some code that would
automatically check the file out immediately upon open, and the check it in,
upon close. And if I had this code, where would it be placed? Is there a
location where you can place code you want executed at open (or close)?

Thanks! Patk

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Auto Check-out / Check -in

Thanks! I shall give that a try. Good points about the sharepoint side.
Did not realize you could "require" checkout. I shall let you know how it
turns out!

Patk

"Barb Reinhardt" wrote:

1) Set up the Document Library to require checkout on Edit.
Settings - Document Library Setting - Versioning Settings

Select Require documents to be checked out before they can be edited.

2) Train the users to EDIT the document in Microsoft Excel,Powerpoint, etc.

On my system, if I open a document and don't check it out to edit, it's
opened as READ ONLY.

Here is some code I use when I want to check out or check in a document
programmatically. I'm not sure it'll do what you want to do though, but it's
a starting point.

Sub UseCheckOut(PPTApp As PowerPoint.Application, doccheckout As String)

' Determine if workbook can be checked out.
'Test for file existance first
If FileExists(doccheckout) Then
If PPTApp.Presentations.CanCheckOut(doccheckout) = True Then
PPTApp.Presentations.CheckOut doccheckout
Else
'MsgBox "Unable to check out this document at this time."
End If
End If
End Sub

Sub CheckIn(aPPS As PowerPoint.Presentation, myComment As String)
aPPS.CheckIn SaveChanges:=msoTrue, Comments:=myComment, MakePublic:=msoFalse
End Sub

Function FileExists(fname) As Boolean
' Returns TRUE if the file exists
Dim x As String
x = Dir(fname)
If x < "" Then FileExists = True _
Else FileExists = False
End Function



--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"PatK" wrote:

I have a "busy" file (sharepoint hosted) that, at particulary times of the
months, many folks converge upon it to provide monthly updates of specific
worksheets.

Sometimes the clobber each other by overwritting each other, etc, because
they fail to check the file out. I would like to write some code that would
automatically check the file out immediately upon open, and the check it in,
upon close. And if I had this code, where would it be placed? Is there a
location where you can place code you want executed at open (or close)?

Thanks! Patk

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
Copy and move check box (check boxes) with new cell link? Marty Excel Worksheet Functions 1 January 20th 10 07:43 PM
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM


All times are GMT +1. The time now is 03:57 PM.

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

About Us

"It's about Microsoft Excel"