Getting file DateModified of a file that is located on Sharepoint

Grand

Board Regular
Joined
May 11, 2017
Messages
52
Hi
I am having trouble getting the last modified date property of a file that is being opened from a location on Sharepoint; and the data is incorrect.

This is whatI am doing:
Code:
[COLOR=black][FONT=Verdana] Function ImportSharePoint()[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]Dim FilePath As String
Dim downloadTime As String
Dim SharePoint_FS As Object
Dim TRowsSourceFile As Long[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]  Set SharePoint_FS = CreateObject("Scripting.FileSystemObject")
     
     'FilePath = InfoSheet.Range("C13").Value
     InfoSheet.Range("D21") = FileDateTime(InfoSheet.Range("C13").Value) ' the date here is buggos
     
     Workbooks.Open Filename:=FilePath, UpdateLinks:=False
     
     'InfoSheet.Range("D21") = SharePoint_FS.GetFile(FilePath).DateCreated
     'InfoSheet.Range("D21") = InfoSheet.Range("C13").Value
     
     Application.StatusBar = "Share point file downloaded. Copying data...."
    
     Set SourceWorkBook = ActiveWorkbook 'the workbook that is just openned
     'etc
     Application.DisplayAlerts = False
     SourceWorkBook.Close
     Application.DisplayAlerts = True
     
    Application.Calculation = xlAutomatic[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]End Function[/FONT][/COLOR]



I must also mention that I get the same property of another file that is located on a network drive without problem but the one from Sharepoint is not correct.

Any help is appreciated.
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top