vba Run-Time error '1004':

jreedp

New Member
Joined
Oct 19, 2014
Messages
8
it worked once then i kept getting the same message

'1004'
Method 'ExportAsFixedFormat' of object 'Range' failed
my vba is:

Sub EXP_PDF()


Dim rng As Range
Set rng = Range("E3:N108")

Dim fileName As String
fileName = "Macintosh HD:Users:jamiecroft:Documents:JRC Music Services:Invoice PDF:Invoive test.pdf"

rng.ExportAsFixedFormat Type:=xlTypePDF, _
fileName:=fileName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=True, _
From:=1, To:=1, OpenAfterPublish:=True
End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
When i select debug it hight lights the bottom:

rng.ExportAsFixedFormat Type:=xlTypePDF, _

fileName:=fileName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=True, _
From:=1, To:=1, OpenAfterPublish:=True
End Sub
 
Upvote 0
Does the directory exist, ezzzactly as spelled?
 
Upvote 0
No suggestion, sorry -- never touched a Mac.
 
Upvote 0
well if it was microsoft the file name would look something like this
Macintosh HD:Users:jamiecroft:Documents:JRC Music Services:Invoice PDF:Invoive test.pdf
C:/Users/jamiecroft/documents/jrc music services/invoice pdf/incoice .pdf

if that helps you at all
 
Upvote 0
i can save the workbook to .pdf.

its is having problems with saving a range to .pdf -- dose anyone no a way of getting a similar result please
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top