Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Illegal operation
Message
From
30/06/1999 04:20:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
29/06/1999 12:48:43
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00235217
Message ID:
00235728
Views:
26
>If you set the visibility of excel to false and then set loExcel to null
>
>Ex:
>
>loExcel = CreateObject('Excel.Application')
>loBook = loExcel.ActiveWorkBook
>lcFileName = "C:\Pam\statusreports\May-Data Man.xls"
>loExcel.Workbooks.Open(lcFileName)
>loExcel.Visible = .T.

I'm opening Excel like this:
x=getfile("xls")
oExcel=createobject("Excel.Application")
oExcel.Workbooks.open(x)

I get no error (except when there's no file), works just fine with Excel 97. I keep doing some extensive knitting around the workbook without having an object referrence to the workbook itself - the next line is oExcel.workbooks(1).activate, and I work with oExcel object only. Works just fine.

>loExcel.Visible = .F.
>* Closes the workbook
>loExcel.WorkBooks.Close
>*Releases the application
>loExcel = .Null.

I'm closing Excel like this:
oexcel.activeworkbook.close(1) && this should be equivalent to save+quit in Excel
release oexcel

It closes both the workbook and excel - in my case, that's exactly what I wanted, because I'm doing an automatic update where Excel remains completely invisible all the time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform