Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Check an a file; SharePoint

I’m following the example he
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

Here’s my code:
' Determine if workbook can be checked in.
If Workbooks(SaveFile).CanCheckIn = True Then
Workbooks(SaveFile).CheckIn
MsgBox SaveFile & " has been checked in."
Else
MsgBox "This file cannot be checked in " & _
"at this time. Please try again later."
End If

‘SaveFile’ is dimmed as a string; it is the name of my Excel file,
which comes from he
SaveFile = Left(imgElement.Title, 27)

I mouse-over the variable and see that the value is correct, but the
code fails on this line:
If Workbooks(SaveFile).CanCheckIn = True Then

SaveFile is checked out from SharePoint. How come I can’t check it
in? Do I need to fully qualify SaveFile with the path to SharePoint
so Excel knows WHERE to check the file in?

I’d appreciate any ideas with this.

Thanks!!
Ryan---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Check an a file; SharePoint

On Jul 23, 2:18*pm, ryguy7272 wrote:
I’m following the example hehttp://msdn.microsoft.com/en-us/libr...ffice.11).aspx

Here’s my code:
' Determine if workbook can be checked in.
If Workbooks(SaveFile).CanCheckIn = True Then
Workbooks(SaveFile).CheckIn
MsgBox SaveFile & " has been checked in."
Else
MsgBox "This file cannot be checked in " & _
"at this time. *Please try again later."
End If

‘SaveFile’ is dimmed as a string; it is the name of my Excel file,
which comes from he
SaveFile = Left(imgElement.Title, 27)

I mouse-over the variable and see that the value is correct, but the
code fails on this line:
If Workbooks(SaveFile).CanCheckIn = True Then

SaveFile is checked out from SharePoint. *How come I can’t check it
in? *Do I need to fully qualify SaveFile with the path to SharePoint
so Excel knows WHERE to check the file in?

I’d appreciate any ideas with this.

Thanks!!
Ryan---


Ok, so I (kind of) got this working and I wanted to share my code for
the benefit of others. This will save a file to SharePoint:
sPath = strpath & "/" & SaveFile
Dim sPathTemp As String
Set xlApp = New Excel.Application
xlApp.Visible = True
Set WB = xlApp.Workbooks.Open(sPath, , False)
xlApp.Workbooks.Application.CalculateFull
Application.DisplayAlerts = False
buildsavedest = sPath
xlApp.Workbooks(SaveFile).SaveAs buildsavedest
Application.DisplayAlerts = True

SaveFile is parsed, as such:
SaveFile = Left(imgElement.Title, 27)

That's simply the file that I'm saving.

The only thing that's I'm struggling with now is to be able to undo
the CheckOut Property (or set the CheckIn Property). Does anyone know
how to do this???
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Check an a file; SharePoint

On Jul 24, 5:25*pm, ryguy7272 wrote:
On Jul 23, 2:18*pm, ryguy7272 wrote:





I’m following the example hehttp://msdn.microsoft.com/en-us/libr...ffice.11).aspx


Here’s my code:
' Determine if workbook can be checked in.
If Workbooks(SaveFile).CanCheckIn = True Then
Workbooks(SaveFile).CheckIn
MsgBox SaveFile & " has been checked in."
Else
MsgBox "This file cannot be checked in " & _
"at this time. *Please try again later."
End If


‘SaveFile’ is dimmed as a string; it is the name of my Excel file,
which comes from he
SaveFile = Left(imgElement.Title, 27)


I mouse-over the variable and see that the value is correct, but the
code fails on this line:
If Workbooks(SaveFile).CanCheckIn = True Then


SaveFile is checked out from SharePoint. *How come I can’t check it
in? *Do I need to fully qualify SaveFile with the path to SharePoint
so Excel knows WHERE to check the file in?


I’d appreciate any ideas with this.


Thanks!!
Ryan---


Ok, so I (kind of) got this working and I wanted to share my code for
the benefit of others. *This will save a file to SharePoint:
sPath = strpath & "/" & SaveFile
Dim sPathTemp As String
Set xlApp = New Excel.Application
xlApp.Visible = True
Set WB = xlApp.Workbooks.Open(sPath, , False)
xlApp.Workbooks.Application.CalculateFull
Application.DisplayAlerts = False
buildsavedest = sPath
xlApp.Workbooks(SaveFile).SaveAs buildsavedest
Application.DisplayAlerts = True

SaveFile is parsed, as such:
SaveFile = Left(imgElement.Title, 27)

That's simply the file that I'm saving.

The only thing that's I'm struggling with now is to be able to undo
the CheckOut Property (or set the CheckIn Property). *Does anyone know
how to do this???- Hide quoted text -

- Show quoted text -



As it turns out, this seems to do the trick:
xlApp.Workbooks(SaveFile).SaveAs buildsavedest
xlApp.Workbooks(SaveFile).CheckIn SaveChanges:=True, _
Comments:=""

Hope this helps others…
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check a file into SharePoint ryguy7272[_2_] Excel Programming 2 July 24th 10 11:35 PM
Check out Excel file from SharePoint; if no other Excel file is op RyGuy Excel Programming 0 May 21st 10 10:32 PM
Sharepoint: How do I upload Excel (2003) Reports to Sharepoint? [email protected] Excel Programming 0 January 29th 09 11:34 AM
Excel links & SharePoint 3.0 (worked fine with SharePoint 2.0) ScottFisher2004 Excel Discussion (Misc queries) 0 November 10th 08 03:26 PM
Sharepoint File Dialog Mike Waldron[_3_] Excel Programming 0 July 9th 07 04:11 PM


All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"