Alguien me puede ayudar.
Hola a todos como puedo pasar una hoja de excel a PDF desde xharbour/FWH.
Atentamente
Julio Ponce
Alguien me puede ayudar.
Hola a todos como puedo pasar una hoja de excel a PDF desde xharbour/FWH.
Atentamente
Julio Ponce
#Include "FiveWin.ch"
#DEFINE Â xlTypePDF Â 0
//-----------------------//
Function Main()
  Local oExcel,cMicSoftPdfDllFile,cPdfFileName
               Â
  oExcel:=CreateObject("Excel.Application")
 Â
  if Val(oExcel:Version) < 12
    MsgInfo("You need excel 2007 or above")
    oExcel:Quit()
    Return .F.
  Endif
 Â
  cMSoftPdfDllFile:=GetEnv("CommonProgramFiles")+"\Microsoft Shared\OFFICE"+;
              Left(oExcel:Version,2)+"\EXP_PDF.DLL"
  If !File(cMSoftPdfDllFile)
    MsgInfo("Microsoft Office PDF add-in is not installed on your PC")
    oExcel:Quit()
    Return .F.
  Endif Â
 Â
  oExcel:Workbooks:Open("D:\YourExcelFile.xlsx")
 Â
  cPdfFileName:="D:\Test.Pdf"  Â
  oExcel:WorkSheets(1):ExportAsFixedFormat( xlTypePDF,cPdfFileName)
                  Â
  oExcel:Quit()
  MsgInfo("Created pdf "+cPdfFileName)                   Â
Return NILGracias
Tengo Office 2010 funcionara?
estoy haciendo el intento y me dice que no esta instalado el ADDIN pero lo buso y si esta la dll.
Atentamente
Julio Ponce
As I don't have Office 2010 here, I have not tried. This is working fine with Office 2007.
Did you manually check the path for the DLL file ie C:\Program Files\Common Files\Microsoft shared\OfficeXX\EXP_PDF.DLL
Regards
Anser