Posts by sharifadabi


    I have a picture and some graphics in an Excel sheet (page plot), and I need to add code to create pdf report from this sheet by ignoring the print area.

    I have customized the page setup:

    then I print the desired range:

    range_to_plot.ExportAsFixedFormat Type:=xlTypePDF, FileName:=my_file_name, IncludeDocProperties:=True, IgnorePrintAreas:=True, OpenAfterPublish:=True

    the issue is that the resulting first page of the pdf file is a picture, and I need to remove all margins to fill the whole width and height of the page. But I couldn't find a way to do that, especially since it seems only the header and footer for the first page can be customized.

    Thanks, but I actually need to keep the format and instead of inserting from my local storage, load from within excel. So, I want to use it in the header of the first page. Something like this:

    With ws.PageSetup

    .FirstPage.CenterHeader.Picture.FileName = "image"

    End With

    I have a problem with loading a picture from inside Excel workbook.

    So, instead of a code like this:

    .picture.filename = "C:\Data\H74_.jpg"

    I'd like to call the picture already copied in another sheet or in image_control. Is there an easy way to do it?

    Thanks a lot