Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tamar's ExcelServeObject??
Message
From
11/11/2002 10:16:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Tamar's ExcelServeObject??
Miscellaneous
Thread ID:
00720998
Message ID:
00720998
Views:
58
Hi
After years of doing Automation by hand I finally am trying to use the serve object from OffAutomation Book
the following code does not work and I don't know why:

LOCAL oExcel, oRange, cRow
_VFP.DATATOCLIP(,,3)
oExcel=THISFORM.cusExcel1 && added the serve object to the form
oExcel.lOpenAsNeeded=.T.

WITH oExcel
.OpenServer()
IF NOT .IsServerOpen()
WAIT WINDOW "Couldn't open Excel."
RETURN .F.
ENDIF
.ShowServer() && for debugging
* Create a workbook
.NewDocument()
x1=.IsDocOpen() && returns FALSE <------------------------------------Why, I can see a sheet in excel!
* Check whether workbook is open
IF x1
WITH .oDocument.Sheets[1]
oRange=.RANGE("a1:z2")
oRange.SELECT()
.PASTE
ENDWITH
ENDIF
ENDWITH
oRange=""
oExcel=""
RETURN


Thanks

Peter
Peter Cortiel
Next
Reply
Map
View

Click here to load this message in the networking platform