Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2 Excel Automation Questions....Date & Win98
Message
 
À
28/05/2002 10:35:12
N. Lea
Nic Cross Enterprises
Valencia, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00662013
Message ID:
00662078
Vues:
13
To your #1. It is a matter of formatting. For instance:

ObjExcel= CREATEOBJECT("Excel.Application")
with ObjExcel
.Workbooks.add()
do case
case "You need 'D' field"=""
.Range("A1").Value="05/04/2002" && you will get "C" field

.Range("A1").Value="Hello"
.Range("A2").FormulaR1C1 = "05/05/2002"
.Range("A3").FormulaR1C1 = "=R[-1]C+1"
.Range("A3").Copy
.Range("A3:A27").Select
.ActiveSheet.Paste
.ActiveWorkbook.SaveAs("c:\test.xls")
endwith
ObjExcel.quit
release ObjExcel

import from c:\test.xls xls
>Good morning! I have two questions that I have been trying to go over this past weekend. I remember seeing the question about the date somewhere, but I cannot seem to find it. Hopefully, someone here will be able to help me out.
>
>1) When using automation to bring over data from an XL5 file (from Excel XP to VF7), the dates come over as character opposed to the date format. I remember somewhere that states VF transforms the date into character via a particular process. It does some mathmatical computation, which I do not remember. It had to do with a particular date and also divded by 364 or something like that. Can anyone help with this problem?
>
>2) I created an excel automation process in Windows XP Pro Environment using VF7. However, when I attempt to run it on a Windows 98 environment, it fails to work. I installed VF7 on the 98 machine, in hopes that I would discover something with it. When I looked up the Excel Constants in the Object Browser, I could not find the ones for Excel. I thought they were not there, so I manually brought it over to the Object Brower window. The process still did not work. Any suggestions as to why the automation would not work? It returns a fatal exception error (no BSOD), but a OLE Fatal Error. Thanks for any insight on this matter.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform