mar. 25 juillet 2017, 11h12
Hamidou
Maroc
atoutfox.public.association
Re: j'ai 2 versions d'office d'installé
Salut
on peux controler le format de la feuille pour connaitre la version:
xlworkbook.FileFormat
voir l exemple ci-dessous
SET STEP ON
m_file="mafeuille.xlsx"
*insert_config.location
m.location='C:\Users\mypc\Downloads'
=excelconv()
PROCEDURE excelconv
oExcel = CREATEOBJECT("Excel.Application")
xlworkbook = oExcel.Workbooks.Open(ALLTRIM(m.location)+"\"+m_file)
lnFormat = xlworkbook.FileFormat
*
https://www.rondebruin.nl/win/s5/win001.htm*
* les valeurs possibles lnFormat sont:
*!* 51 = pour 2007-2016, xlsx)
*!* 52 = pour 2007-2016, xlsm
*!* 50 = pour xlsb binaire non conseillé
*!* 56 = pour 97-2003 format dans Excel 2007-2016, xls
*
* pour la sauvegarde j utilise la valeur 39
xlworkbook.SaveAs(ALLTRIM(m.location)+"\"+LEFT(ALLTRIM(m_file),LEN(ALLTRIM(m_file))-4)+".xls",39) &&,43)
*RELEASE oExcel
xlworkbook.saved = .t.
xlworkbook.close
oExcel.quit
RETURN
esperons que ça aidera
cordialement
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000018353