Excel won't close from Access Automation 
Author Message
 Excel won't close from Access Automation

Hi,
I've got the following code which populates an Excel spreadsheet. The
problem is that Excel stays in memory and hangs my machine.
Q199219 was recently offered as a solution, but does not solve my
problem as I'm not using the 'with' construct.
Can anyone help ?
thanks,
Graham

snipped code:
Set xls = New Excel.Application
xls.Visible = True
Set wkb = xls.Workbooks.Open(strFilePath & strOutputFile)
xls.Sheets("TitleSheet").Select
xls.Range("A1").Select
wkb.Save
wkb.Close
xls.Quit
Set wkb = Nothing
Set xls = Nothing

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 10 May 2003 03:00:00 GMT  
 Excel won't close from Access Automation
Hi Graham--

Don't know for sure if this will help (haven't used Access to supply
data to Excel, but I've had a similar problem going to Word), but it
looks like you may not be properly setting and releasing object
variables. Check out Q178510 and the two other articles it references,
see if that helps.

cheers,
s

Quote:

> Hi,
> I've got the following code which populates an Excel spreadsheet. The
> problem is that Excel stays in memory and hangs my machine.
> Q199219 was recently offered as a solution, but does not solve my
> problem as I'm not using the 'with' construct.
> Can anyone help ?
> thanks,
> Graham

> snipped code:
> Set xls = New Excel.Application
> xls.Visible = True
> Set wkb = xls.Workbooks.Open(strFilePath & strOutputFile)
> xls.Sheets("TitleSheet").Select
> xls.Range("A1").Select
> wkb.Save
> wkb.Close
> xls.Quit
> Set wkb = Nothing
> Set xls = Nothing

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 10 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Excel won't release itself from memory during Access automation

2. Excel won't release itself from memory during Access automation

3. Excel won't close within Access Appl

4. Excel from Access - Won't Close

5. Access won't close excel

6. Excel from Access - Won't Close

7. Excel won't close within Access

8. Access/Excel Automation - Excel Not Closing

9. Access/Excel Automation - Excel Not Closing

10. Can't Close Excel With Automation


 
Powered by phpBB® Forum Software © phpBB Group