Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21281

.vbs Check out sharepoint file, run macro, save, checkin

$
0
0
Good afternoon!
Ive been working on this for what seems like hours.

The title says it all.

I'm trying to set up a VBScript to be ran by Scheduled Tasks.

I need to open a file on Sharepoint, Run a macro, Save, then check the file back in. But I keep receiving errors here and there.

I am using the below. Any thoughts or suggestions would be great! I needed this completed this morning :( Thank you so much!

I am also receiveing an error: "Object doesn' support this property or method; objexcel.application.workbook.checkin'
Code:

set objExcel = CreateObject("Excel.Application")
drPath = "http://mysites.sharepoint.xxx.xxx.xxx/script%20test.xlsm"
if (objExcel.Workbooks.CanCheckOut(drPath) = True) then
objExcel.Application.Workbooks.Open drPath
objExcel.Application.Workbooks.CheckOut drPath
objExcel.Application.run"'Script Test.xlsm'!Test"
objExcel.application.save
objExcel.Application.Workbooks.Checkin drPath

else
msgbox "Cannot currently checkout file."
end if


Viewing all articles
Browse latest Browse all 21281

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>