Hello,
I am using the following code in Excel VBA to try to get the file name, create date and modify date for a folder on our site. I keep getting the error: "There was an unknown error." Any assistance would be greatly appreciated.
Sub ScanPPRevisions()
'**************************************************************************
'* Delcare Variables
'**************************************************************************
Dim oPPSession As New ppSession
Dim oPPFolder As PPFOLDER
Dim oPPFolders As PPResourceCollection
Dim oPPFolderItem As IPPResource
Dim sResourceUrl As String
Dim sResourceUrl2 As String
Dim sUserName As String
Dim sPassword As String
'*************************************************************************
'* Set Variables
'*************************************************************************
sResourceUrl = "https://webdav.buzzsaw.com/SiteName"
sResourceUrl2 = "Root/Folder"
sUserName = "xxxxx"
sPassword = "xxxxx"
On Error GoTo except
oPPSession.LogOut
oPPSession.LogIn sUserName, sPassword, sResourceUrl
Set oPPFolder = oPPSession.GetResource(sResourceUrl2)
Set oPPFolders = oPPFolder.SubFolders
'**************************************************************************
'* Insert Column Headers
'*************************************************************************
r = 1
Cells(r, 1) = "FileName"
Cells(r, 2) = "CreateDate"
Cells(r, 3) = "ModifiedDate"
Range("A1:C1").Font.Bold = True
r = r + 1
'**************************************************************************
'* Loop through all items and list the file name, create date and modified date
'**************************************************************************
For Each oPPFolderItem In oPPFolders
If oPPFolderItem.Type = PPFOLDER Then
Cells(r, 1) = oPPFolderItem.Name
Else:
Cells(r, 1) = oPPFolderItem.Name
Cells(r, 2) = oPPFolderItem.CreationDate
Cells(r, 3) = oPPFolderItem.LastModifiedDate
End If
Next oPPFolderItem
MsgBox "List Complete"
Exit Sub
except:
Dim sDec As String
sDec = oPPSession.GetPPErrorInfo(Err.Number)
MsgBox sDec, , "Login Failure"
oPPSession.LogOut
End Sub
Thank you
Tim