Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy to / export type xls
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01128551
Message ID:
01128569
Views:
18
>Excluding dbf field names in the XLS worksheet?
* Coipy to XLS and delete the first row
lcXlsFile = FULLPATH("Test.xls")
COPY TO (lcXlsFile) XL5
oExcel = CreateObject("Excel.Application")
*oExcel.Visible = .T.
oWorkbook = oExcel.Workbooks.Open(lcXlsFile)
oWorkbook.ActiveSheet.Rows(1).Delete()
oWorkbook.Save()
oExcel.Quit

* or
* Coopy to CSV, open and save as XLS
#DEFINE xlWorkbookNormal	-4143	
lcXlsFile = FULLPATH("Test.xls")
lcCsvFile = FORCEEXT(lcXlsFile, "CSV")
COPY TO (lcCsvFile) DELIMITED WITH "" with CHARACTER ,
oExcel = CreateObject("Excel.Application")
*oExcel.Visible = .T.
oWorkbook = oExcel.Workbooks.Open(lcCsvFile)
oWorkbook.SaveAs(lcXlsFile, xlWorkbookNormal)
oExcel.Quit
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform