General information
Category:
COM/DCOM and OLE Automation
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"
otherwise
.Range("A1").Value="Hello"
endcase
.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
So you need to preformat the column. Another solution is:
create curs temp (_date D)
append from (Excelfile) xls
Your #2. What line of code initiates the error?
>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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only