Flyin Brian
New Member
- Joined
- Jan 15, 2021
- Messages
- 4
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
They say a little knowledge is a dangerous thing. Alas...
I have scoured this and other sites but can’t seem to find an answer to my problem:
I am trying to save a Macro-enabled Excel file to a shared folder in our Company’s Enterprise SharePoint.
The file name will be dependent on a concatenated text string found in a cell.
So far, I have managed to glean that I need to use backslashes, ie: ‘\\mysharepoint.SharePoint.com\rest_of_the_path
I need to add the & “\” after the path to separate the path from the filename,
Then for the filename, I have, filename1 = Range(“A1”)
And then I put it all together for it to say,
Dim Path As String
Dim filename1 as String
ThisWOrkbook.SaveAs filename1:=Path & “\” & filename1 & “xlsm”, FileFormat:=xLOpenXMLWorkbookMacroEnabled
But.. no matter what I do, it comes back as “Run-time error 1004 - Method ‘SaveAs’ of object ‘_Workbook’ failed.
The DeBug then takes me to the above line.
What am I doing wrong?
Any assistance would be greatly appreciated!
Thanks!
I have scoured this and other sites but can’t seem to find an answer to my problem:
I am trying to save a Macro-enabled Excel file to a shared folder in our Company’s Enterprise SharePoint.
The file name will be dependent on a concatenated text string found in a cell.
So far, I have managed to glean that I need to use backslashes, ie: ‘\\mysharepoint.SharePoint.com\rest_of_the_path
I need to add the & “\” after the path to separate the path from the filename,
Then for the filename, I have, filename1 = Range(“A1”)
And then I put it all together for it to say,
Dim Path As String
Dim filename1 as String
ThisWOrkbook.SaveAs filename1:=Path & “\” & filename1 & “xlsm”, FileFormat:=xLOpenXMLWorkbookMacroEnabled
But.. no matter what I do, it comes back as “Run-time error 1004 - Method ‘SaveAs’ of object ‘_Workbook’ failed.
The DeBug then takes me to the above line.
What am I doing wrong?
Any assistance would be greatly appreciated!
Thanks!