Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel to recognize FoxPro memo fields?
Message
 
 
À
19/07/2000 12:12:24
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00393509
Message ID:
00394494
Vues:
9
i get a ole error code 0x800a03ae on the below "=&value" statment when the field is a blank date field. obviously i could do a TYPE on the field and figure out if it is a null date, but what other field types and values do i have to do special validation for before doing the oExcel.activecell.value assignment?

lvalue = lcalias + "." + FIELD(lni)
oExcel.ActiveCell.Value = &lvalue

thanks

brenda


>Just do an oExcel.SaveAs("C:\Book3.xls"). Named parameters aren't allowed when doing Automation from FoxPro. The other parameters it put in the macro code appear to be default values, so you shouldn't have pass them. If you need to pass them, then you'll need to find the parameter order and pass them as you would to a function/method call.

>>thanks for the info and code. works well. but now i want to save the workbook as a specific name in a specific folder. went into excel, recorded a macro and then look at the VB code. i added the oExcel. before the ActiveWorkbook.Saveas. but i get a syntax error when i execute it in the command window.
>>
>>oExcel = CREATEOBJECT('Excel.Application')
>>oExcel.workbooks.add
>>oExcel.ActiveWorkbook.SaveAs FileName:="C:\Book3.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False


>>>LOCAL oExcel, lnlast, lcalias, lvalue, lnrow
>>>oExcel = CREATEOBJECT('Excel.Application')
>>>* Create a new work sheet
>>>oExcel.Workbooks.Add
>>>lcalias = ALIAS()
>>>lnlast = FCOUNT()
>>>lnrow = 0
>>>SCAN
>>> lnrow = lnrow + 1
>>> FOR lni = 1 TO lnlast
>>> lccell = CHR(64 + lni) + TRANSFORM(lnrow)
>>> oExcel.Range(lccell).Select
>>> lvalue = lcalias + "." + FIELD(lni)
>>> oExcel.ActiveCell.Value = &lvalue
>>> NEXT
>>>ENDSCAN
>>>Of course, if you have more than 26 fields, you'll have to make an adjustment >in the column name.

>>>What do you mean by "Automation"? and what is AFAIK?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform