Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
-\) -\) is offline
external usenet poster
 
Posts: 18
Default Remote shut down of Excel

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







  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Remote shut down of Excel

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









  #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











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup causes Excel to shut down FinChase Excel Discussion (Misc queries) 1 July 11th 09 03:09 PM
Ignoring code to shut a workbook if it is already shut Cammy Excel Discussion (Misc queries) 1 September 12th 06 06:12 PM
Shut down excel Greg B Excel Discussion (Misc queries) 1 April 26th 05 07:05 AM
Excel instance not shut down Macca Excel Worksheet Functions 0 December 13th 04 03:55 PM
Error causes Excel to shut down quartz Excel Programming 0 January 20th 04 04:01 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"