Macro to call a SharePoint

cates79

New Member
Joined
Aug 18, 2018
Messages
3
I am looking for a macro to call a SharePoint, select a file and have it auto populate into a designated tab. I have the below macro which allows be to select a file from my folders located on my computer but I cannot figure out how to do it with SharePoint. Anyone's help would be most appreciated.

Code:
Sub Reporting()


' Daily Macro

    Dim tool_ws, filename, raw_ws, data_sheet As String

    With Application
      tool_ws = ActiveWorkbook.Name
      filename = .GetOpenFilename("Excel Files (*.xls),*.xls," & "Text Files (*.txt),*.txt," & "All Files (*.*),*.*", 3, "Select the eLetters Data Source file")
    End With
    
    If filename = False Then
      MsgBox "No file was selected to process"
      Exit Sub
    Else
      Workbooks.Open filename                                                   ' open raw data file to process
      raw_ws = ActiveWorkbook.Name
    End If


    Application.ScreenUpdating = False
    
    Range(Range("A1"), Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Workbooks(tool_ws).Activate
    Sheets("Data Source").Select
    Range("A1").Select
    ActiveSheet.Paste
    
    
    Sheets("Data Source").Name = "Data Source"
    Range("A2").Select
    ActiveCell.EntireRow.Delete
    
   
    Application.DisplayAlerts = False
    Workbooks(raw_ws).Close
    Application.DisplayAlerts = True
    
    Application.ScreenUpdating = False
    
    
    With Application
      filename = .GetOpenFilename("Excel Files (*.xls),*.xls," & "Text Files (*.txt),*.txt," & "All Files (*.*),*.*", 3, "Select the Media Bin file")
    End With
    
    If filename = False Then
      MsgBox "No file was selected to process"
      Exit Sub
    Else
      Workbooks.Open filename                                                   ' open raw data file to process
      raw_ws = ActiveWorkbook.Name
    End If

    Application.ScreenUpdating = False
    
    Range(Range("A1"), Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Workbooks(tool_ws).Activate
    Sheets("Extract").Select
    Range("A1").Select
    ActiveSheet.Paste
    
    
     Sheets("Data Source").Name = "Data Source"
     Range("A2").Select
     ActiveCell.EntireRow.Delete
    
   
    Application.DisplayAlerts = False
    Workbooks(raw_ws).Close
    Application.DisplayAlerts = True
    
    Sheets("Extract").Select
    
End Sub
 
Last edited by a moderator:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,215,694
Messages
6,126,252
Members
449,305
Latest member
Dalyb2

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