Saving Files to SharePoint (teams)

cowells

New Member
Joined
Feb 21, 2016
Messages
21
Hello!

looking for a bit of help. I have a file that resides inside a folder on SharePoint site which I have access to. The file is called master file, I run a macro inside this master file to load a number of worksheets into it for analysing. Once the analysing is finished I want to save a copy the file back to SharePoint with the name appended with today’s date or a date to be agreed. So I have a record of the changes made during the analysis phase. Leaving the master intact as I have further macro that runs on a button click, to clear the master. Once, all the analysis is completed. Leaving the file ready for the next import in a weeks time.

Struggling to find a code to do thisi, with maybe asave as feature or save new file even. watch, can anybody help? Or point me in the right direction.

Thanks in advance.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Question, can you save to this SharePoint location the same way you save to a directory to your computer? e.g. File>save as>{browse to location}>{enter name}>save
 
Upvote 0
Question, can you save to this SharePoint location the same way you save to a directory to your computer? e.g. File>save as>{browse to location}>{enter name}>save
Good question!

I don’t think so, as file explorer doesn’t see the SharePoint site. However I can get a link to the site that allows me to copy the files I mentioned into the workbook…

it uses https://site.SharePoint….etc
 
Upvote 0
I've thought a bit and did a quick search but wasn't able to make anything of it. I have a snippit of code that I put in some of my workbooks that does what you're asking locally, I will grab it and post it here just in case when I get home, but again...it's not exactly what you're looking for.
 
Upvote 0
Here is the date snippit, but again, I believe it only works locally.
VBA Code:
Option Explicit

Sub fileSave()
Dim path As String, FileName As String, OldFileName As String
path = ThisWorkbook.path
OldFileName = Left(ThisWorkbook.name, InStr(ThisWorkbook.name, ".") - 1)
FileName = Format(Date, "ddmmyyyy") & OldFileName 'Format of the filename to save; Date & Original filename without extension
ThisWorkbook.SaveAs path & "\" & FileName & ".xlsm"
'uncomenting will delete original after making new file.
'Kill path & "\" & OldFileName & ".xlsm"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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