LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default CheckOut/CheckIn from/to SharePoint 2010

Has anyone else come across this and know of a fix?

Here's the CheckOut code, as it comes from Excel 2010 Help...

Sub UseCheckOut(docCheckOut As String)

' Determine if workbook can be checked out.
If Workbooks.CanCheckOut(docCheckOut) = True Then
Workbooks.CheckOut docCheckOut
Else
MsgBox "Unable to check out this document at this time."
End If

End Sub

....For me this 'almost' works. As the requested file opens I get the
Enable Macros prompt, I click Enable and then I see the workbook open
briefly and immediately close.

The only way I've had any degree of success is to use the Open method
aswell...

Sub UseCheckOut(docCheckOut As String)

' Determine if workbook can be checked out.
If Workbooks.CanCheckOut(docCheckOut) = True Then
Workbooks.CheckOut docCheckOut
Workbooks.Open docCheckOut
Else
MsgBox "Unable to check out this document at this time."
End If

End Sub

However, there are a couple of problems with this. Firstly, I get the
Enable macros prompt twice - I don't want users to see that. Secondly,
I want the file to check itself back in when the Before_Close event
fires. If the file closes immediately after being checked out it will
obviously check itself back in. When the code then opens the workbook
with the Open method the file is in the wrong state according to
SharePoint.
 
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
Mark if checkin date is within 30 days of checkout date where name isthe same. steve1040 Excel Programming 4 July 13th 10 07:41 AM
How to CheckIn a checked out file in VBA? Revolvr Excel Programming 0 August 12th 09 08:12 PM
Method 'CheckIn' of object '_workbook' failed Bill Schanks Excel Programming 1 May 9th 06 10:04 PM
Checkin into SPS prompts no matter what... Lasse Bjerre Knudsen Excel Programming 0 June 29th 04 08:46 AM


All times are GMT +1. The time now is 02:14 AM.

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"