Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel to recognize FoxPro memo fields?
Message
 
 
To
19/07/2000 12:12:24
Jonathan Cochran
Alion Science and Technology
Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00393509
Message ID:
00394494
Views:
10
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform