-
August 23rd, 2013, 03:08 PM
#1
Invalid Procedure Call or Argument
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, _
OpenAfterPublish:=True
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
-
August 26th, 2013, 10:28 AM
#2
Re: Invalid Procedure Call or Argument
Please use CODE tags when posting code, it makes it much better to read and possibly identify the problem(s)
-
August 26th, 2013, 02:19 PM
#3
Re: Invalid Procedure Call or Argument
Sorry this is my first port - how do i use a CODE tag please.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|