Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB code to save file update info to sharepoint excel file

Status
Not open for further replies.

Randy11

Technical User
Oct 4, 2002
175
CA
Am having some difficulty overcoming a problem saving file update info to a sharepoint location.
Essentially, active workbook when an update button is clicked on it sends User Name, File Name and Date & Time to a tracker workbook. Had this working on a prior version not in sharepoint. Assistance with the code would be seriously appreciated.


Sub btnUpdate_Click()
Application.ScreenUpdating = False
Dim fileSys As Object
Dim txtStream As Object
Dim logFile As String

logFile = "http:\\vr6tpt09\depts\Action Assessment\Action Tracker 2010.csv"

Set fileSys = CreateObject("scripting.filesystemobject")
Set txtStream = fileSys.OpenTextFile(Filename:=logFile, iomode:=8, Create:=True, Format:=-2)

txtStream.WriteLine (ActiveWorkbook.Name & "," & Format(Now(), "mm/dd/yyyy") & "," & Format(Now(), "HH:MM") & "," & Application.UserName)

Workbooks.Open Filename:="http:\\vr6tpt09\depts\Action Assessment\Action Tracker 2010.csv"""
Range("A1:D2245").Select
Selection.Copy
Workbooks.Open Filename:="http:\\vr6tpt09\depts\Action Assessment\Action Tracker 2010.csv"
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWorkbook.Close
ActiveWorkbook.Close
Application.ScreenUpdating = False

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top