Saving Excel Workbook to Sharepoint

Santude

New Member
Joined
Jul 28, 2012
Messages
18
Good evening,

I am trying to save an Excel Workbook to a specific SharePoint Directory. I have copied the SharePoint link and placed it in my code, however I am getting the following error message:

1701661480141.png


I can paste the copied SharePoint link in a new browser and I am able to access the site. I have copied the the VBA Code I have written below:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Code Start''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub MultiSaveAsCQ()

Dim result As Variant
Dim AtiveBook As Workbook
Dim strPath As String
Dim Path As String

Application.ScreenUpdating = False
Application.DisplayAlerts = False

strPath = "https://goodmanglobal.sharepoint.co...uswr1epBThLmabMnOT5VcwB40EYZ0x_5KY3UzTTQI4srw"

result = Application.GetSaveAsFilename(filefilter:="Excel File (*.xlsm), .xlsm", Title:="Save File As")

If result <> 0 Then

ActiveWorkbook.SaveAs FileName:=result, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

End If

ActiveWorkbook.SaveCopyAs strPath + ActiveWorkbook.Name

ActiveWorkbook.Save


Application.ScreenUpdating = True
Application.DisplayAlerts = True


MsgBox ("Your file has been saved!")


End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Code End'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Thank you in advance for any help you can provide....
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
You could have more than one problem but the one that jumps out is that you need a slash at the end of your path before you add the file name
Rich (BB code):
strPath = "https://goodmanglobal.sharepoint.com/:f:/s/DCBUProposalTool/Euswr1epBThLmabMnOT5VcwB40EYZ0x_5KY3UzTTQI4srw/"

I am not a big fan of using "+" for string concatenation but it does work so that's not causing your problem.
 
Upvote 0
Thank you Jeff for your quick response. Unfortunately that did not work, I am still getting the same error.....Although I can say I feel like an idiot for not catching that.
 
Upvote 0
Question, could my issue be stemming from the internet browser? It works great on Microsoft Edge, but not on Internet Explorer (IE)?
 
Upvote 0
The :f:/s/ part should not be there.
 
Upvote 0
That path is still wrong. I don't believe a SP path would have all those numbers in it and it certainly couldn't have the question mark. How are you getting the path?
 
Upvote 0
There is a Copy Link within SharePoint Directory I am trying to save into. I am trying to save the file without the end user knowing. File names will always be different.

1701704265374.png
 
Upvote 0
That won't work as a directory. At a minimum you also need to remove the question mark and everything after it from the link.

Click on Details on the right-hand side, then click More details at the bottom of the info window, and then you'll see a Path section with an icon to copy it.
 
Upvote 0
Solution
YOU ROCK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If I could, I would buy you a steak dinner!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
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