View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272[_2_] ryguy7272[_2_] is offline
external usenet poster
 
Posts: 56
Default Save a file to SharePoint


I know this code was working yesterday; today it is NOT working:

SaveFile comes from parsing a string, as such:
SaveFile = Left(imgElement.Title, 27)

Here’s the code that I was using to save a file to SharePoint, and
make the status of the file NOT checkedout.

Dim bk As Workbook
Dim APP As Excel.Application
Dim obj
Set bk = Workbooks(SaveFile)
Set APP = bk.Parent
APP.Workbooks(SaveFile).CheckIn
bk.Activate
bk.CheckIn
Workbooks(SaveFile).Activate
Workbooks(SaveFile).Save
Workbooks(SaveFile).CheckIn
bk.undocheckout

It seems to be very simple to check in ThisWorkbook, but very
difficult to checkin another file that is NOT ThisWorkbook.

Any ideas on how to do this?

As always, thanks!