Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBF to fomatted xls spreadsheet
Message
From
04/08/2003 19:49:04
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
04/08/2003 12:34:04
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00816537
Message ID:
00816689
Views:
17
>I would like some input on how to copy data to an already formatted excel spreadsheet. This is something for very new to me. So if any has any ideas please email me back. Thanks in advance.

Hi Kimberly,

You haven't said what your data is like. Is there a lot of data? Do you have a table or specific values that you have in variables or arrays? Here's some code that might get you started:
oExcel = CREATEOBJECT("Excel.Application")
oExcel.Visible = .T. && For testing.
*!* Book1 exists in Excel's default directory.
oExcel.Workbooks.Open("Book1.xls") 

*!* Enter values one at a time.
oSheet = oExcel.ActiveSheet
oSheet.Range("B5").Value = 42

*!* Enter a whole table.
SELECT SomeTable
GO TOP
_VFP.DataToClip(,,3)
oSheet.Range("B5").Select()
oExcel.Paste()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform