I have an odd Expected End Sub error that is occurring.
The macro below is activated manually by a button and it is in a workbook that is shared by multiple people.
When I run macro on my computer, it runs fine. When a coworker runs the macro, it has gives the following error:
Compile error: Expected End Sub
I don't know why this is occurring and I can't duplicate it on my computer.
Public Sub AutoPDF()
Dim strPath As String
Dim strName As String
Dim myFile As Variant
Dim wbA As Workbook
Dim strPathName As String
Set wbA = ActiveWorkbook
Worksheets("FS").Visible = xlSheetHidden
Worksheets("Minutes").Visible = xlSheetHidden
strPath = wbA.Path & "\"
strName = wbA.Name & ".pdf"
strPathName = strPath & strName
myFile = Application.GetSaveAsFilename(InitialFileName:=strPathName, fileFilter:="PDF Files (*.pdf), *.pdf", Title:="Select Folder and File Name to Save")
If myFile <> "false" Then
wbA.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End If
Worksheets("FS").Visible = xlSheetVisible
Worksheets("Minutes").Visible = xlSheetVisible
End Sub