Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export Excel Workbook to .PDF
Message
From
13/01/2018 14:16:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Export Excel Workbook to .PDF
Miscellaneous
Thread ID:
01657177
Message ID:
01657177
Views:
63
            string xlsfilename = ConfigurationManager.AppSettings["XLSFilesPath"] + "ps20180113.xls";
            string pdffilename = ConfigurationManager.AppSettings["PDFFilesPath"] + "testps20180113.pdf";

            Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
            Microsoft.Office.Interop.Excel.Workbook wbv = excel.Workbooks.Open(xlsfilename);
            Microsoft.Office.Interop.Excel.Worksheet wx = excel.ActiveSheet as Microsoft.Office.Interop.Excel.Worksheet;
            if (File.Exists(pdffilename))
            {
                File.Delete(pdffilename);
            }

            wbv.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, pdffilename);

       
            wbv.Close(true, Type.Missing, Type.Missing);
            excel.Quit();
The above C# code creates a .pdf from an Excel Worksheet
I can't find the equivalent code to do it with VFP

Any ideas?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Next
Reply
Map
View

Click here to load this message in the networking platform