Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel File Version Identification
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Excel File Version Identification
Divers
Thread ID:
01176025
Message ID:
01176025
Vues:
62
Hi Friends,


With the above mentioned code i am making necessary processing on the excel file. The Excel version i am using is Excel 2003 and i can open unprocessed and processed files in that excel version.

When these processed files reached to the client he states that they are not Excel 2003 files but Excel 2000 or Excel 97 files. Any suggestions or method to know which Excel version a .xls file belong.
Local loX
loX = Createobject("EXCEL.application")
loX.Workbooks.Open( Fullpath(myExcelFile)) && 

&& CELL Formating and Conversion Process
loX.Columns("A:IV").Select
loX.Selection.NumberFormat = "@"				&& Setting the format of the column as "Text" or being precise "AS ENTERED"
lcROWTOTCOUNT=loX.Cells.SpecialCells(11).Row			&& 11 stands as constant to give value for the filled cell in the column
lcCOLTOTCOUNT=loX.Cells.SpecialCells(11).Column			&& 11 stands as constant to give value for the filled column
For lcROWCOUNTER = 1 To lcROWTOTCOUNT				&& Going though every value in the column to the number of rows till the data is filled
	For lcCOlCOUNTER = 1 To lcCOLTOTCOUNT			&& Going though every value in the column to the number of rows till the data is filled
		If Type('loX.Cells(lcROWCOUNTER,lcCOlCOUNTER).Value')='N'		&& Checking for its type to be Numeric
			loX.Cells(lcROWCOUNTER,lcCOlCOUNTER).Value = Padl(Alltrim(Str(loX.Cells(lcROWCOUNTER,lcCOlCOUNTER).Value,14)),8,'0')	&& Converting in the desired format
		Endif
	Next
NEXT

*Updates to Autofit the columns of the entire excel file
loX.Columns("A:IV").Select
loX.Selection.Columns.AutoFit						&& Autofit the contents of the column


loX.DisplayAlerts = .F.
loX.Save()
loX.Workbooks.Close()
Release loX
Thanks.
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform