Hi
So I want my code to loop through and check if folder in sharepoint exists and if so then save PDF into it depending on the business unit. if there is no folder then create it.
I get an error saying 'bad file name'Sub SaveTo_SharePoint busUnitList = Array( "A", "B", "C", "D", "E", "F", "G" ) Dim strFile As String strFile = "http://site/Reporting%20Documents/" For Each busUnit In busUnitList If Dir(strFile, vbDirectory) = busUnit Then ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, fileName:="http://site/Reporting%20Documents/" & fileName, IgnorePrintAreas:=False, OpenAfterPublish:=False Else MkDir (strFile & fileName) End If Next busUnit End Sub
Anyone know why?
Thanks