MrPink1986
Active Member
- Joined
- May 1, 2012
- Messages
- 252
Hi there,
I have a macro enabled workbook with multiple sheets - I want to save one sheet from this workbook on to SharePoint. The sheet I want to save is "Output".
The error I get is that Excel cant find the find the file (Run time error '1004) - it is like it is looking for the file before it is saved?
Any help with this one is greatly appreciated.
Thanks
Stephen
I have a macro enabled workbook with multiple sheets - I want to save one sheet from this workbook on to SharePoint. The sheet I want to save is "Output".
VBA Code:
Sub UploadtoSharePoint()
Dim pathsp As String
Dim SDate As String
Dim FDate As String
Set wb = ActiveWorkbook
Sheets("Output").Select
Set shtE = ActiveSheet
'Sheets("Overview").Select
'Set shtView = ActiveSheet
SDate = shtE.Range("C3").Value
FDate = VBA.Format(shtE.Range("C3").Value, "yyyy-mm-dd") & ".xlsx"
Set wbTemp = Workbooks.Open(stalesP & FDate, UpdateLinks:=False)
Set shtTemp = ActiveSheet
pathsp = "https://xxxprod.sharepoint.com/:f:/r/sites/xxxxxmplemenation/Shared%20Documents/General?csf=1&web=1&e=eZCkOH/"
wbTemp.SaveAs pathsp & "Output----" & FDate, FileFormat:=51, CreateBackup:=False
wbTemp.Close savechanges:=False
End Sub
The error I get is that Excel cant find the find the file (Run time error '1004) - it is like it is looking for the file before it is saved?
Any help with this one is greatly appreciated.
Thanks
Stephen