View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Olivia Towery
 
Posts: n/a
Default CreateObject("Excel.Application")

Yes, I have the xls.DisplayAlerts = False statement.

The app works great on most workbooks. The problem only occurs when the
workbook is larger than say 1000 lines per sheet. When it is less than
that, the app quits and redirects as it should.

Any other suggestions are greatly appreciated.


"Jim Cone" wrote in message
...
Olivia,

Are you closing the active workbook?
Save As does not close both workbooks - only one.
When you close a workbook or quit Excel, Excel throws up a
message asking if you want to save any open workbooks.
It must be responded to.
To avoid this...Active.Workbook.Close SaveChanges:=False ' or True
or possibly xls.DisplayAlerts = False

Also, it is easy to leave orphan references in Excel which can prevent
Excel from closing.
Are you setting all object variables to nothing? (child then parent)
It's usually best to avoid references to ActiveSomething, instead use
object references to refer to the ActiveSheet, ActiveWorkbook, ActiveCell
and all others.
Avoid the use of the "With" construct.
Finally, thought it appears you are getting away with it, I would not use
xls as the application object reference.

Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Olivia Towery"

wrote in message
Each month this object runs in an asp application to create a workbook

from
5 separate tables in a SQL 7.0 db. The app is great and performs
successfully with the exception if the file is large - maybe 1000 lines

per
spreadsheet - 800KB. The last lines of code are as follows:

xls.ActiveWorkbook.SaveAs server.MapPath(".") & "\" & fName
xls.Quit
Set xls = Nothing ' Release the object variable.
set rsTbl1 = Nothing

Response.Redirect ("https://www.foo.org/" & strChap & "/admin/" &
strRedirect & ".asp?File=" & strfile & "")

Once it completes the SaveAs command, the app hangs. It never quits or

goes
to the response.redirect. Does anyone no how to fix this issue? Or if I
should be in another newsgroup?
Olivia