Home > front end >  Grindline showing when creating a PDf from XLSX
Grindline showing when creating a PDf from XLSX

Time:09-24

I have this simple code, that just takes a template and I'm trying to convert it to a pdf.

The code works but the pdf have the excel gridlines

PDf Image

At the moment i´m using xlwings to create the pdf but i can switch to another library if I need to

import xlwings as xw

with xw.App(visible=False) as app:

    wb = app.books.open('Template.xlsx')
    wb.to_pdf('test.pdf')

CodePudding user response:

Follow these steps:

  1. Open the 'Print Menu' in excel.
  2. Find the option called 'Page Setup' See this image to find the 'Page Setup Option'
  3. Then in the 'Page Setup' option go to 'Sheet' tab and then locate the 'Gridline' option. 'Sheet Tab' and Gridline option location
  4. Simply uncheck the gridline options and you are done. Then try running your macro again.
  • Related