Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Upload to sharepoint

Hi all,
Im trying to found the proper code for saving a file with VBA to a document
library in Sharepoint.
Thanks in advance,
Assaf
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Upload to sharepoint

here is what I'm look to do.. this works, but also fails if a user is not
logged into the Sharepoint server.

' Determine if workbook can be checked out.
On Error GoTo ErrorHandler
'Fails if User not Logged into Sharepoint
If Workbooks.CanCheckOut(Filename:=savename) = True Then
Workbooks.CheckOut savename
MsgBox "Checked out file from IntraSha " & file
End If

'I actually don't need to open file
'Workbooks.Open (savename)

'Instead save over it.
ActiveWorkbook.SaveAs Filename:=savename,
FileFormat:=xlWorkbookNormal
'Check it in -- works if I checked it Out

If Workbooks(ActiveWorkbook.Name).CanCheckIn = True Then
Workbooks(ActiveWorkbook.Name).CheckIn
savechanges:=SaveDuringClose, Comments:="", MakePublic:=True
MsgBox file & " has been checked in."
Else
MsgBox "This file cannot be checked in " & _
"at this time. Please try again later, " & _
"someone else who has write access could have it Checked
Out."

End If



Else
ErrorHandler:
MsgBox ("You may need to log into Sharepoint Server for this process
to work.")
ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=xlWorkbookNormal
If Closefile = True Then ActiveWorkbook.Close
savechanges:=SaveDuringClose
End If

Try this.. the path you might need is something like this:
Public Const SharePointPath = "\\sharepoint.xxxxxx.com\sites\mysite\"
The add your document library to the path after that.

dalejrstwin

"Lp12" wrote:

Hi all,
Im trying to found the proper code for saving a file with VBA to a document
library in Sharepoint.
Thanks in advance,
Assaf

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
how to upload exl Bob I Excel Discussion (Misc queries) 0 February 10th 09 02:10 PM
Excel links & SharePoint 3.0 (worked fine with SharePoint 2.0) ScottFisher2004 Excel Discussion (Misc queries) 0 November 10th 08 03:26 PM
Is there a way to upload a spreadsheet here? ericm Excel Discussion (Misc queries) 7 July 18th 08 11:13 PM
Upload back changes made in downloaded Excel copy to SharePoint Li Amitabh Excel Discussion (Misc queries) 0 September 27th 07 08:02 AM
Upload Error Arcadian Excel Discussion (Misc queries) 0 April 29th 07 05:46 AM


All times are GMT +1. The time now is 04:29 AM.

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

About Us

"It's about Microsoft Excel"