Workbooks.Open Filename:= _ "" 'Destination workbook Sharepoint URL Worksheets("").Activate 'Destination sheet 'code to prepare print area etc Windows("A").Activate 'Source workbook 'code to select source data for copying Windows("B").Activate 'Destination workbook 'code to paste data If Workbooks.CanCheckOut("") = True Then ActiveWorkbook.CheckOut 'to check out destination workbook Else 'code to handle error and close destination workbook End If If ActiveWorkbook.CanCheckIn = True Then ActiveWorkbook.CheckIn ActiveWorkbook.Close Windows("A").Activate MsgBox "The file has been checked in." Else 'code to handle error and close destination workbook End If
Example:This example verifies that a workbook is not checked out by another user and can be checked out. If the workbook can be checked out, it copies the workbook to the local computer for editing.
Sub UseCanCheckOut(docCheckOut As String) ' Determine if workbook can be checked out. If Workbooks.CanCheckOut(Filename:=docCheckOut) = True Then Workbooks.CheckOut (Filename:=docCheckOut) Else MsgBox "You are unable to check out this document at this time." End If End Sub
Quote: Animation description: In the SharePoint document library, the Web address, or URL of the library to publish to, is visible at the top of the window. The New button is visible, which means that the person who sees the button has the SharePoint permissions to save files to the library. In Excel, the cursor clicks the Microsoft Office Button Button image, points to Publish, and clicks Excel Services. In the File Name box, the document library URL is entered (leaving "Forms/AllItems.aspx" off at the end). In the Save as type box, Excel Workbook is selected (there are only two Excel file formats to use when you publish a workbook to Excel Services: Excel Workbook and Excel Binary Workbook). The cursor clicks Save. The document library appears in the Save as window. A file name is entered, and the cursor clicks Save again to publish the file to the document library.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)