Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. set objExcel = CreateObject("Excel.Application")
  2. drPath = "serverfile"
  3. if (objExcel.Workbooks.CanCheckOut(drPath) = True) then
  4. objExcel.Application.Workbooks.CheckOut drPath //note - may need to open first
  5. objExcel.Application.Workbooks.Open drPath
  6. else
  7. msgbox("Unable to checkout SharePoint file: " & file.name & ". Please contact an administrator.")
  8. end if
  9.  
  10. Private Sub Workbook_Open()
  11.  
  12. 'The following command is equivalent to hitting the "Edit" bar
  13. 'that comes up when you open an Excel file by clicking on it in SharePoint,
  14. 'which is equivalent to "Edit in Microsoft Excel" (not CheckOut)
  15.  
  16. ActiveWorkbook.LockServerFile
  17.  
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement