Monday, 15 September 2014

sharepoint - vbscript to check in excel file -


I am trying to write a VBSSPT to be able to check an Excel file that is stored on the SharePoint server .

At the moment I can check the file with

, however, I am trying to check the file back but is not enabled. I searched and tried the checkout function for each, but not enabled.

Currently I have the code

  set the sub-checkin file dims ExcelApp, ExcelSheet, ExcelBook dim myURL myURL = "Http: //server/Site/excel.xlsx" ExcelApp = CreateObject ("Excel.Application") if (ExcelApp.WorkBooks.CanCheckIn (myURL) = true) then the msgbox ("here") ExcelApp.WorkBooks.Open (MyURL) ExcelApp.Application.WorkBooks.CheckIn myURL ExcelApp.ActiveWorkbook Close 'Exit Excel' ExcelApp.Quit 'Clean Up Set Excel App = Finish If End Sub   

However the script prevents and fails on the statement, but does not execute . Is there a similar VBScript function to check in the file?

Just try it out:

  Modified ExcelApp, ExcelSheet, ExcelBook dim MyURL = "http: //server/Site/excel.xlsx" ExcelApp = Set UpObject ("Excel.Application") ExcelApp.WorkBooks.Open (myURL) If (ExcelApp. ActiveWorkbook.CanCheckIn = True) then ExcelApp.Application. WorkBooks (myURL). CheckIn ExcelApp.ActiveWorkbook.Close 'Exit Excel ExcelApp.Quit' Clean Up Set Up ExcelApp = If No End If    

No comments:

Post a Comment