Opening csv from in Sharepoint and saving to Excel on Desktop

Occasional Visitor

Hello,

I have a macro that copies a CSV file from a sharepoint folder and pastes it to a workbook on my desktop. The issue is when I step in to the sub, it shows as if it opens the file but it looks like an old file on my downloads folder that I downloaded the first time, not the file saved in sharepoint. It is like if it opened a temporary file downloaded previously as it says last modified May 11 but it was created just now (06/02)

Here is my path: ("https://XXXX.sharepoint.com/sites/Reports/Shared Documents/Production Reports/Data/Conversion.csv")

Also tried path: ("https://XXXX.sharepoint.com/sites/Reports/Shared%20Documents/Production%20Reports/Data/Conversion.CS...")

and path: ("\\XXXX.sharepoint.com\sites\Reports\Shared Documents\Production Reports\Data\Conversion.CSV")

The last 2 options say the file could not be located.

Here is the whole code:

 

 

 

Dim conversionWB As Workbook, ThisWB As Workbook
    Application.ScreenUpdating = False
    Set ThisWB = ActiveWorkbook

    Set conversionWB = Workbooks.Open("https://XXXX.sharepoint.com/sites/Reports/Shared Documents/Production Reports/Data/Conversion.csv")
        
    ActiveSheet.Copy after:=ThisWB.Sheets(ThisWB.Sheets.Count)
    conversionWB.Close False

 

 

 

0 Replies