I have had some code which has always worked fine. However now it keeps erroring for some reason, I have highlighted where the script is erroring. I am simply trying to export the sheet to a pdf.
The value in S2 was previously this
="AdminList "&TEXT(Controls!$B$2,"MMMM DD YYYY ")&TEXT(List!$M2,"h.mmAM/PM")
But i thought it was an error with that so I just changed it to text so it read "Admin List 1", this worked the first time that I ran it but after that it errored out again. I also have an admin list 2,3 and 4 and another bit of code that merges them and all have worked fine up until this point.
Admin List 1
I am guessing the error is with the file name but any help would be appreciated. I would prefer to have the formula as the file name but am flexible with what works
The value in S2 was previously this
="AdminList "&TEXT(Controls!$B$2,"MMMM DD YYYY ")&TEXT(List!$M2,"h.mmAM/PM")
But i thought it was an error with that so I just changed it to text so it read "Admin List 1", this worked the first time that I ran it but after that it errored out again. I also have an admin list 2,3 and 4 and another bit of code that merges them and all have worked fine up until this point.
Admin List 1
I am guessing the error is with the file name but any help would be appreciated. I would prefer to have the formula as the file name but am flexible with what works
VBA Code:
Sub admissionsource1()
Dim FolderPath As String
Sheets("Adm SStats 1").Select
[B]ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("S2").Value, _
openafterpublish:=False, ignoreprintareas:=False[/B]
Sheets("Adm SStats 1").Select
Range("A1").Select
End Sub