Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open Excel sheet in Form
Message
 
To
27/12/2006 08:42:25
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01180450
Message ID:
01180786
Views:
14
Here is some starter code VBA Automation - it does not use the ActiveX
oldOnError=on('error')
ON ERROR oExcel=.NULL.
oExcel=getobject(,'Excel.Application')
ON ERROR &oldOnError
IF isnull(oExcel)
   oExcel=createobject('Excel.Application')
ENDIF 
WITH oExcel
.WorkBooks.Add
.displayalerts=.f.
nWorkBookSheets=.Sheets.Count
* Get rid of extra sheets
FOR c = nWorkBookSheets TO 2 STEP -1
.sheets(c).delete
ENDFOR &&c = nWorkBookSheets TO 2 STEP -1
oSheet=oExcel.ActiveSheet
*!*	oSheet.StandardWidth = 8.43
*!*	oSheet.RowHeight = 12.45
* Update status mesg and progress here
* Format Columns Data
ENDWITH &&oExcel
If you have VFP 8 you can drive this from the command window - the autocomplete will expose the available properties and methods - sometimes its a lot easier to test from command window than it may be to debug a PRG.

There are also some downloads and articles for Excel Automation and Excel Charts in the UT download area.


>Dear Experts
>
>On Form, I droped Activex Control (Ole Control).
>How to open some Excel sheet with this Activex Control?
>After modification, How to save this sheet.
>
>Or is there any other method to open Excel sheet within a Form?
>
>Please help
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform