Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to open an excel file in VFP
Message
 
 
To
27/01/2003 19:43:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00746047
Message ID:
00746080
Views:
19
Jeana,

This will open up a spreadsheet:
oExcel = createobject( "excel.application" )
oExcel.Visible = .t.
oExcel.Workbooks.Open( "TheSpreadsheet.xls" )
This will bring it to the foreground;
DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER
SetForegroundWindow( oExcel.Hwnd )
The user can do what ever they want inside Excel.

If they shutdown Excel then you can test it from inside VFP:
if ( type( "oExcel.ActiveWindow" ) = "U" )
Then you can just get rid of your object with:
oExcel = .null.
>1. Open an excel worksheet within VFP ( How To ???)
>2. Let the user update excel work sheet
>3. If user clicks “close” in excel , close the excel sheet in prg. (How To ??)
>4. Get on with my program.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform