Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dates in excel 2010
Message
 
 
À
30/11/2012 09:56:02
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Divers
Thread ID:
01558464
Message ID:
01558485
Vues:
50
>>Try "Save As"
>
>Easier: since I already have a list of date column names, I'm simply widening the column so the .text will be a digit now:
>
*---------------------------------------------------
>	PROCEDURE GetColumnNames(tn)
>*[2012/11/26 17:39:35] ndragan - just use the clipboard
>		LOCAL aF[1], lnfields
>		loXls=this.oexcel
>		loxls.ActiveSheet.ROWS(tn).SELECT
>		loxls.SELECTION.COPY()
>		_CLIPTEXT=TRIM(_CLIPTEXT, 1, 0h0d)
>		lnfields=ALINES(aF, _CLIPTEXT, hTab)
>		DIMENSION THIS.aFld[lnFields]
>		ACOPY(aF, THIS.aFld)
>		*[2012/11/30 15:20:39] ndragan - widen the date fields so that Excel2010 doesn't see ######.
>		FOR i=1 to lnFields
>			IF lower(af[i])$this.cValueFieldsList
>				loxls.columns(i).ColumnWidth = 15.57
>			endif
>		ENDFOR
>
>Which now works even without saving the file. I just wish I didn't have to waste so much time on this.
>
>

PMFJI. I am always looking at how people extract data from excel to VFP. And I am trying to understand your code but it goes over my head. Hopefully, if it is not too much trouble, I can ask you. How do you get the value of 'tn" that you pass to this function? And one more; what is the 'this.oexcel' you use in this function? TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform