I have code that generates a log file in notepad each time an excel template is opened. Currently it is storing the master file on a shared drive but I have been asked to move it to the company's sharepoint site. I have never coded any interaction with sharepoint in VBA so I am at a complete loss. Any and all help would be much appreciated. Below is my current VBA that is initiated when the template's are opened. I am using Office 2007 if that is of any help.
Thanks in advance for your help.
[code]
Private Sub Workbook_Open()
LogInformation ThisWorkbook.Name & ", opened by ," & _
Application.username & ", on ," & Format(Now(), "yyyy-mm-dd h:mm AM/PM")
End Sub
Sub LogInformation(LogMessage As String)
Const sLogFN As String = "\\Logs\ACT_VAR.LOG"
Dim iFN As Integer
On Error Resume Next
iFN = FreeFile 'next file number
Open sLogFN For Append As #iFN 'creates the file if it doesn't exist
Print #iFN, LogMessage 'write information at the end of the text file
Close #iFN 'close the file
On Error GoTo 0
End Sub
Bookmarks