I have just copied an EXCEL spreadsheet M/S 2007 - from a W7 to a W8 environment and get the error "Invalid Procedure Call or Argument"
The code that seems to be failing is

On Error GoTo err
With ActiveSheet
.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FileFullPath, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _

The code immediately preceeding this is

Sub Send_Acative_Spreadsheet_as_PDF_via_Gmail()

' PART1 - Create a PDF file of the active worksheet

Dim OlApp As Object
Dim NewMail As Object
Dim TempFilePath As String
Dim TempFileName As String
Dim FileFullPath As String

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

' Temporary file path where pdf
' file will be saved before
' sending it in email by attaching it.

'TempFilePath = Environ$("C:\Invoices") & "\"
TempFilePath = Environ$("temp") & "\"
' Now append a date and time stamp
' in your pdf file name. Naming convention
' can be changed based on your requirement.

TempFileName = ActiveSheet.Name & "-" & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" '

'TempFileName = ActiveSheet.Name & "-" & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf"
'TempFileName = ActiveSheet.Name & ".pdf"
'Complete path of the file where it is saved
FileFullPath = TempFilePath & TempFileName

'Now Export the Activesshet as PDF with the given File Name and path

Any ideas please