Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking access to Sharepoint prior to use
Is there a way I can check Sharepoint log ins prior using Excel's VBA
sharepoint features to save files to a sharepoint site? I already have this code: Public Const SharePointPath = "\\sharepoint.xxxxxx.com\sites\mysite" ' Determine if workbook can be checked out. On Error GoTo ErrorHandler 'Fails if User not Logged into Sharepoint If Workbooks.CanCheckOut(Filename:=savename) = True Then Workbooks.CheckOut savename MsgBox "Checked out file from SharePoint: " & file End If 'I actually don't need to open file 'Workbooks.Open (savename) 'Instead save over it. ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=xlWorkbookNormal 'Check it in -- works if I checked it Out If Workbooks(ActiveWorkbook.Name).CanCheckIn = True Then Workbooks(ActiveWorkbook.Name).CheckIn savechanges:=SaveDuringClose, Comments:="", MakePublic:=True MsgBox file & " has been checked in." Else MsgBox "This file cannot be checked in " & _ "at this time. Please try again later, " & _ "someone else who has write access could have it Checked Out." End If Else ErrorHandler: MsgBox ("You may not be able to log into Sharepoint Server for this process to work.") ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=xlWorkbookNormal If Closefile = True Then ActiveWorkbook.Close savechanges:=SaveDuringClose End If Thanks, Dalejrstwin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel links & SharePoint 3.0 (worked fine with SharePoint 2.0) | Excel Discussion (Misc queries) | |||
Checking to see that a CHART exists prior to running a simple command | Excel Discussion (Misc queries) | |||
Checking Client Status Prior to Save | New Users to Excel | |||
Checking documents into Sharepoint | Excel Discussion (Misc queries) | |||
Delete Worksheets Prior To Access DoCmd.TransferSpreadsheet | Excel Programming |