View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
-\) -\) is offline
external usenet poster
 
Posts: 18
Default Remote shut down of Excel

Thanks, I will try it after my coffee.

I have 20 production/product lines. Only one line is run at a time. Each
has 1 to 5 excel workbooks. I just chose this method because it was the
first one I tried and now I don't want to mess with a working application.

The user can watch any of the excel sheets working this way, and if any dies
the others are not effected. These are (mostly) created by the clients
engineering dept with various levels of programming knowledge.

My next product line (the last) will combine ~8 linked(altho local)
workbooks into one with a user interface and the remote control function
listed here.


"keepITcool" wrote in message
...
show the user forms Modeless.

then you have no problems closing the running books
or instances.

also..
WHY are you running 20 excel INSTANCES?
iso 1 instance with 20 workbooks?


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


";-\)" wrote:

Something that I did realize was that the excel workbooks that are
giving problems are the ones where my function forces a user-form to
open and it stays open until the workbook closes.

So there maybe an event I need to set to clean up the shut down?

Any thoughts?


";-)" wrote in message
...
This code works for ~20 sets of excel workbooks. ONE of the sets (a
single workbook) always crashes the workbook, with a request to
contact MS with the error report. The last crash gave me a DDE
server crash error.

Is there any thing in the sheet that would cause this?



For i = 1 To rsMaster.RecordCount
'Set xl(i) = New Excel.Application 'Early binding
Set xl(i) = CreateObject("Excel.Application") 'Late Binding
With xl(i)
If admin Then 'hide from user?
.Visible = True
Else
.Visible = False
End If
.Application.WindowState = xlMinimized
.Application.DisplayAlerts = False
.Workbooks.Open FileName:=(pathExcel & rsMaster!Source),
UpdateLinks:=0, ReadOnly:=False
End With
rsMaster.MoveNext
Next i

'...much work done

Set rsLbl = xl(i).Application.Run("getRs", rsLbl) 'call Excel
Function

'...much work done

'now end
For Each x In xl()
x.ActiveWorkbook.Saved = True x.Quit
Set x = Nothing
Next