Página 1 de 1

problem with Tregistry(open Key)

Publicado: Dom Mar 18, 2012 2:05 am
por psfaro
Hi ,
I'm experienced an error after upgrading 2.0 to Xailer 2.5
I used the Method to Determine the excel Extension
METHOD ExcelExtensao() CLASS Copia2XLS
Local oWinReg
Local cExt
Local cFile
With Object oWinReg := TRegistry():New()
:Root := HKEY_LOCAL_MACHINE
DO CASE
CASE :OpenKey("SOFTWAREMicrosoftOffice11.0ExcelInstallRoot ") == 0
//cFile := :GetString("Path") + "EXCEL.EXE"
vExcel:="2003"
cExt := ".XLS"
CASE :OpenKey("SOFTWAREMicrosoftOffice12.0ExcelInstallRoot ") == 0
//cFile := :GetString("Path") + "EXCEL.EXE"
vExcel:="2007"
cExt := ".XLSX"
CASE :OpenKey("SOFTWAREMicrosoftOffice14.0ExcelInstallRoot ",0) == 0
vExcel:="2010"
cExt := ".XLSX"
OTHERWISE
vExcel:="2007"
cExt := ".XLSX"
ENDCASE
End With
Return cExt
In Xailer 2.5, the Excel 2010 , the openKey returns 2
In Xailer 2.0, the Excel 2010 , the openKey returns 0 , wich is ok.
Office 2010 is 64b
Regards
Pedro