Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot sort by date when data export to Excel
Message
De
22/10/2012 06:18:50
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Cannot sort by date when data export to Excel
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01555430
Message ID:
01555430
Vues:
58
Hi,

I find that when I export some data to a Excel file which have the date field
in the first column, it cannot be sorted by the date field it in Excel.

Why ?

My code as following
use invoice
SELECT invoice
EXPORT TO invenq.xls TYPE XLS FIELDS delidate, invno, stock
oExcel = CREATEOBJECT([Excel.Application])
oWorkbook = oExcel.Workbooks.open("C:\WTS\MID\INVENQ.XLS")
oExcel.Visible = .t.
lnLastRow = oExcel.activesheet.UsedRange.Rows.Count
lnLastCol = oExcel.activesheet.UsedRange.Columns.Count
oExcel.activesheet.Range("A2:A"+TRIM(PADR(lnLastRow,11))).NumberFormat ='dd/mm/yyyy'
where the delidate is a date type field.

But If I manually create a new worksheet and I key in the date field,
then it can be sorted.

Why ? Please advise.
Thanks.
Derek
Répondre
Fil
Voir

Click here to load this message in the networking platform