Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel instantiation and Illegal Operation Error
Message
From
04/02/1999 18:01:54
Carol Adler
U.S. Army Kwajalein
Apo, Marshall Islands
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00183729
Message ID:
00184108
Views:
21
I tried this new code, but it doesn't check to see if an instance of Excel is already running. Okay, I'm not a purist so I'll forget about checking, especially since the user has a new 333 running NT.

The "&&Do stuff here" needs to be under total control of the user to format, e-mail, etc. If I add the code to close and quit, the user has no opportunity to do anything.

If I leave out the close and quit, and the user selects File Close instead of Exit, then I get the illegal operation.

Did I leave something out?


SET SAFETY OFF
USE finance_report in 0
COPY fields except travnbr_b, travnbr_c to c:\temp\text.xls type xls
SET SAFETY ON
tmpsheet=getObject('','excel.application')
oExcel = tmpsheet.application
oExcel.workbooks.open("c:\temp\text.xls")
oExcel.visible = .t.
oExcel.cells.select
oExcel.selection.columns.autofit
oExcel.range("A1").select

-- Now the user needs total control of their spreadsheet

Release oExcel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform