I am creating PDFs from excel templates. We have one worksheet that contains pricing data which is used on other worksheets. I programmatically open the pricing worksheet (pricelist) and insert the price in the appropriate cell. The vlookups are used to pull that data into the other worksheets.
I I save the workbook as an excel file it works great. I open the workbook and the data is populated appropriately.
If I save the workbook as a pdf the vlookups do not work. The pricing data is not populated. Below is a code snippet that demonstrates simply inserting one price and saving to pdf. I have attached the template.xslx file as well.
vartestWorkbook = new Workbook(@"C:\template.xlsx");
Good to know that your issue is resolved following the suggestion by Shakeel Faiz.
Also, whenever you need to update or insert values into the cells, you will always need to call Workbook.CaculateFormula() method before rendering to PDF, so the formulas are calculated based on the updated/inserted values.