Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dates in excel 2010
Message
De
30/11/2012 17:12:41
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:
01558506
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.

Tn is the row with the header, usually 1 but I've seen multiline headers, so I've put it as parameter just in case.

"This" is, in my case, a wrapper class that has all the code I'd need that's common to various import scenarios; this.oExcel is an instance of excel that it creates.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform