Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table to Excel
Message
From
07/01/2004 18:22:20
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
07/01/2004 18:09:05
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00864895
Message ID:
00864903
Views:
15
Joel,
Here is some quick code that will show one way to do it using the clipboard. You could also insert values directly into cells.

Gary


LOCAL oExcel

oExcel = NULL

USE MyTable
_vfp.DataToClip('MyTable',RECCOUNT('MyTable'), 3)

oExcel = CREATEOBJECT('Excel.Application')

IF !ISNULL(oExcel)
oExcel.Workbooks.Add
oExcel.ActiveSheet.RANGE('A1').SELECT
oExcel.ActiveSheet.Paste()
oExcel.visible = .T.
oExcel.ActiveSheet.RANGE('A1').SELECT

*-- Windows API call to set the top window
DECLARE integer BringWindowToTop IN WIN32API integer
BringWindowToTop(oExcel.Hwnd)
ENDIF



>How do I send a table to Excel?
>
>I know I just:
>Use MyTable
>Copy to MyTableExcel type xls
>
>But I want to open Excel and have it displaying MyTableExcel
Previous
Reply
Map
View

Click here to load this message in the networking platform