+ Reply to Thread
Results 1 to 1 of 1

Maintain Audit Log file on Sharepoint using Excel VBA

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    13

    Unhappy Maintain Audit Log file on Sharepoint using Excel VBA

    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
    Last edited by mustang1966; 08-08-2012 at 04:42 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1