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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

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