Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formatting a date column in Excel wtih automation
Message
De
30/01/2006 01:37:13
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Formatting a date column in Excel wtih automation
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01091328
Message ID:
01091328
Vues:
80
Hi,

I'm trying to format a column in an excel spreadsheet into a date format with excel automation.

The following code:

oExcel = CreateObject("Excel.Application")
oWOSRWorkBooks = oExcel.WorkBooks.Open(tcXLFile)
oExcel.Visible = .T.
oWOSR = oWOSRWorkBooks.WorkSheets[1]
oWOSR.Columns("Q").NumberFormat = "dd/mm/yyyy" && Format to date

appears to work until I open the spreadsheet, right click on the desired column and click on "Format Cells". The category has been set to "Custom". I want it to be set to "Date". Does anyone know how to use excel automation to set the format of a column to "Date"?

Thanks,
Gavin.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform