• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

save as pdf

i have this code and works with some problems
Code:
Sub Savealltopdf()


  Dim SaveAsStr As String

  SaveAsStr = ActiveWorkbook.Path & "\" & ActiveSheet.Range("Af2").Value

  Dim x As Integer

  ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Quality:=xlQualityMinimum, filename:=SaveAsStr & ".pdf", IncludeDocProperties _
  :=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub

all i want to do is to save the wb to pdf and name based on cell value but i want to save it in options publish what entire workbook. as image shows
 

Attachments

  • shot-save-pdf-3.png
    shot-save-pdf-3.png
    22.3 KB · Views: 5
Last edited:
yes i know that i have made a lot of search and tries to fix my problem but nothing works. the only that works is that option but i have to choose it manually
i can't put this option in a code
 
kingcashandcarry
So You didn't check that link and
You didn't try below part of sample code?
Code:
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\marks\Documents\Saved PDF.pdf"
 
yes i have read the link and thank you very much for your try
i always appreciate people that try to help me with vba
now i have try all the possible codes but the result is not the desired
the code that you send me is already in my sub

so now to try to describe my problem
in sheets i have images that are linked to images stored in a folder.
all images are visable but when i use the code to export all sheets to pdf some of images are not displayed with a message
"this image cannot currently be displayed"
but if the procedure i make it manually (go to save as pdf choose minimum size and to options entire workbook
the exported pdf is just perfect
i hope to be understood
and again thank you for your attention
 
So what do you get if you record manual process using Macro Recorder?

Also, if you want to get more specific help. Upload sample file where your code will create the PDF with said issue. That way, us helpers and quickly test our solution.
 
sorry for the long time to answer to my thread
i have end up that my problem is caused by memory thing
i explain. when i run the macro that save all my workbooks to pdf if there is an open application that uses memory then i have that problem.
so now before i use the macro i close all running application and then i run the macro. it's quite painful but it's a solution

and again thank you all for your support.
 
Back
Top