Results 1 to 4 of 4

Thread: Print pdf without grid

  1. #1
    Board Regular
    Join Date
    Dec 2016
    Posts
    192
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Print pdf without grid

    Here is my existing code. I would like to NOT print the gridlines. I thought I could just add "PrintGridlines:=False", but that didn't work.


    Else
    'export to PDF in current folder
    wsA.ExportAsFixedFormat _
    Type:=xlTypePDF, _
    Filename:=strPathFile, _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True
    'confirmation message with file info
    MsgBox "PDF file has been created: " _
    & vbCrLf _
    & strPathFile
    End If


  2. #2
    Board Regular
    Join Date
    Dec 2015
    Posts
    300
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Print pdf without grid

    Maybe this?
    Code:
    Else
    'export to PDF in current folder
    wsA.PageSetup.PrintGridlines = False
    wsA.ExportAsFixedFormat _
    Type:=xlTypePDF, _
    Filename:=strPathFile, _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True
    'confirmation message with file info
    MsgBox "PDF file has been created: " _
    & vbCrLf _
    & strPathFile
    wsA.PageSetup.PrintGridlines = True
    End If

  3. #3
    Board Regular
    Join Date
    Dec 2016
    Posts
    192
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Print pdf without grid

    Thank you. Works perfect. I didn't see anything like this in my searching. "wsa". I'll research the wsa so I know what its doing.
    Again thanks for your time!
    have a great weekend!

  4. #4
    Board Regular
    Join Date
    Dec 2015
    Posts
    300
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Print pdf without grid

    Sorry for the delayed response. Just moved to a new house and haven't had much free time. From what I can gather in your code, wsA is the worksheet you're doing all of this in. So the
    Code:
    wsA.PageSetup.PrintGridlines = False
    goes into the page setup of the worksheet and actually turns off the gridlines. Then in the end of the code the line
    Code:
    wsA.PageSetup.PrintGridlines = True
    turns the gridlines back on after you've already made the pdf.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •