Saving pdf

jebenexcel

Board Regular
Joined
Mar 16, 2018
Messages
59
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="[I]path[/I]" & Firma & "\Offers\" & "OBR1_" & broj & "_" & Firma & "_" & Format(Now(), "dd.mm.yyyy") & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

path is juts your regular C:\etc path... getting an error 1004 on this... Why?
Firma is a string, broj is a number.
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
If path is a string, you don't need to enclose it with double quotes.

What do you see in the debug window if you monitor the following expression?
"path" & Firma & "\Offers" & "OBR1_" & broj & "_" & Firma & "_" & Format(Now(), "dd.mm.yyyy") & ".pdf"
 
Upvote 0
Runtime error 1004;
Document not saved. The document may be open, or an error may have been encountered while saving.
 
Upvote 0
Remove the two double quotes enclosing the word "path" then run the code. What do you get?
 
Upvote 0
If Path is not a variable, then you need to remove it & put in the actual path
 
Upvote 0
Press F8 to step through the code line by line and monitor the following expression in the debug window. What does it show before the code in #1 is executed?

"path" & Firma & "\Offers" & "OBR1_" & broj & "_" & Firma & "_" & Format(Now(), "dd.mm.yyyy") & ".pdf"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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