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
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:
- Open the 'Print Menu' in excel.
- Find the option called 'Page Setup' See this image to find the 'Page Setup Option'
- Then in the 'Page Setup' option go to 'Sheet' tab and then locate the 'Gridline' option. 'Sheet Tab' and Gridline option location
- Simply uncheck the gridline options and you are done. Then try running your macro again.