IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Comment transformer un fichier excel 3 en excel 5


Sujet :

Macros et VBA Excel

  1. #1
    Membre régulier
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Mai 2005
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet en SSII

    Informations forums :
    Inscription : Mai 2005
    Messages : 112
    Points : 115
    Points
    115
    Par défaut Comment transformer un fichier excel 3 en excel 5
    Bonjour à tous,

    Je dois charger une base MysSQL avec des données provenant de fichier excel (3 & 5).

    Le problème est que pour le moment la classe PHP que j'utilise ne comprend que les fichiers excel 5.

    Existe-t'il un moyen simple (un petit exe par exemple) de convertir un fichier excel 3 en excel 5 ?

    Par avance merci

  2. #2
    Inactif  
    Avatar de ouskel'n'or
    Profil pro
    Inscrit en
    Février 2005
    Messages
    12 464
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 12 464
    Points : 15 546
    Points
    15 546
    Par défaut
    Tu dois pouvoir faire ça en ouvrant Excel, puis ton fichier, puis en enregistrant celui-ci sous VbNormal.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    'ouverture de l'application 
    Set appxl = CreateObject("excel.application") 
    'ouverture du fichier "NomFich.xls" 
    Set appFich = appxl.Workbooks.Open("c:\Rep\NomFich.xls") 
    appFich.saveas  FileName:="NomFich.xls", FileFormat:=xlExcel5
    appFich.close false
    appxl.quit
    Set appxl = Nothing
    Set appFich = Nothing
    Essaie avec ça. Je ne connais pas le VB mais je me suis inspiré de ça
    http://www.developpez.net/forums/viewtopic.php?t=439803
    Jète un oeil.

    A+

  3. #3
    Membre régulier
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Mai 2005
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet en SSII

    Informations forums :
    Inscription : Mai 2005
    Messages : 112
    Points : 115
    Points
    115
    Par défaut
    En fait voici ce dont j'avais besoin a savoir "traduire" un fichier excel d'une version a une autre en php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
     
    $listfiles=read_dir($dir);
     
    $str="";
    foreach ($listfiles as $nomFile){
    	if (strtolower(substr($nomFile,-3)) =='xls'){
    		$excel = new COM("excel.application") or die("Impossible d'ouvrir Excel");
    		print "Fichier ouvert : ".$nomFile."<br>";
    		//Alertes cachées
    		$excel->DisplayAlerts = 0;
    		//ouvrir le fichier
    		$excel->Workbooks->Open($nomFile);
    		/*
    		pour ouvrir "traduire" un vieux fichier ecxcel en excel5/95 il faut lui refiler le format XlFileFormat
    		|-----------|---------------------------|--------------------------------------------------------
    		|	18		|	xlAddIn					|	Microsoft Office Excel Add-In.						|
    		|	17		|	xlTemplate				|	Excel template format.								|
    		|	6		|	xlCSV					|	Comma separated value.								|			
    		|	19		|	xlTextMac				|	Specifies a type of text format.					|
    		|	22		|	xlCSVMac				|	Comma separated value.								|	
    		|	21		|	xlTextMSDOS				|	Specifies a type of text format.					|
    		|	24		|	xlCSVMSDOS				|	Comma separated value.								|	
    		|	36		|	xlTextPrinter			|	Specifies a type of text format.					|
    		|	23		|	xlCSVWindows			|	Comma separated value.								|	
    		|	20		|	xlTextWindows			|	Specifies a type of text format.					|
    		|	41		|	xlCurrentPlatformText	|	Specifies a type of text format						|
    		|	42		|	xlUnicodeText			|	Specifies a type of text format.					|
    		|	7		|	xlDBF2					|	Dbase 2 format.										|		
    		|	45		|	xlWebArchive			|	MHT format.											|
    		|	8		|	xlDBF3					|	Dbase 3 format.										|	
    		|	14		|	xlWJ2WD1				|	Deprecated format.									|
    		|	11		|	xlDBF4					|	Dbase 4 format.										|	
    		|	40		|	xlWJ3					|	Deprecatedformat.									|
    		|	9		|	xlDIF					|	Data Interchange format.							|	
    		|	41		|	xlWJ3FJ3				|	Deprecated format.									|
    		|	16		|	xlExcel2				|	Excel version 2.0.									|	
    		|	5		|	xlWK1					|	Lotus 1-2-3 format.									|
    		|	27		|	xlExcel2FarEast			|	Excel version 2.0 far east.							|	
    		|	31		|	xlWK1ALL				|	Lotus 1-2-3 format.									|
    		|	29		|	xlExcel3				|	Excel version 3.0.									|	
    		|	30		|	xlWK1FMT				|	Lotus 1-2-3 format.									|
    		|	33		|	xlExcel4				|	Excel version 4.0.									|	
    		|	15		|	xlWK3					|	Lotus 1-2-3 format.									|
    		|	35		|	xlExcel4Workbook		|	Excel version 4.0. Workbook format.					|
    		|	32		|	xlWK3FM3				|	Lotus 1-2-3 format.									|
    		|	39		|	xlExcel5				|	Excel version 5.0.									|	
    		|	38		|	xlWK4					|	Lotus 1-2-3 format.									|
    		|	39		|	xlExcel7				|	Excel 95.											|
    		|	4		|	xlWKS					|	Lotus 1-2-3 format.									|
    		|	43		|	xlExcel9795				|	Excel version 95 and 97.							|	
    		|	-4143	|	xlWorkbookNormal		|	Excel workbook format.								|
    		|	44		|	xlHtml					|	Web page format.									|
    		|	28		|	xlWorks2FarEast			|	Microsoft Works 2.0 format							|
    		|	26		|	xlIntlAddIn				|	Microsoft Office Excel Add-In internationalformat.	|	
    		|	34		|	xlWQ1					|	Quattro Pro format.									|
    		|	26		|	xlIntlMacro				|	Deprecated format.									|
    		|	47		|	xlXMLData				|														|
    		|	2		|	xlSYLK					|	Symbolic link format.								|
    		|	48		|	xlXMLSpreadsheet		|	Excel Spreadsheet format.							|
    		|-----------|---------------------------|--------------------------------------------------------
    		*/
     
    		$excel->Workbooks[1]->SaveAs($nomFile,39);
     
    		//closing excel
    		$excel->Quit();
     
    		//free the object
    		$excel->Release();
    		$excel = null; 
    	}
    }

  4. #4
    Inactif  
    Avatar de ouskel'n'or
    Profil pro
    Inscrit en
    Février 2005
    Messages
    12 464
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 12 464
    Points : 15 546
    Points
    15 546
    Par défaut
    En fait voici ce dont j'avais besoin a savoir "traduire" un fichier excel d'une version a une autre en php
    Oui ? Tu as une question ou tu as résolu ton pb ?

    A+

  5. #5
    Membre régulier
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Mai 2005
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet en SSII

    Informations forums :
    Inscription : Mai 2005
    Messages : 112
    Points : 115
    Points
    115
    Par défaut
    Comme tu peut le voir c'est

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XSD] Comment transformer un fichier xml en fichier xsd (java)
    Par mehdiing dans le forum Format d'échange (XML, JSON...)
    Réponses: 1
    Dernier message: 20/03/2008, 11h21
  2. comment transformer un Fichier xls (Excel) en XML
    Par sperron dans le forum XML/XSL et SOAP
    Réponses: 4
    Dernier message: 13/04/2006, 16h35
  3. [XSL] comment transformer ce fichier xml en une table html ?
    Par jlassira dans le forum XSL/XSLT/XPATH
    Réponses: 17
    Dernier message: 15/03/2006, 12h15
  4. [XSL] Comment transformer un fichier XML en un autre XML
    Par elzedo dans le forum XSL/XSLT/XPATH
    Réponses: 6
    Dernier message: 16/01/2006, 10h51
  5. Réponses: 4
    Dernier message: 23/06/2005, 12h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo