PC Review


Reply
Thread Tools Rate Thread

Instances of Excel don't release

 
 
Richard Choate
Guest
Posts: n/a
 
      26th Jun 2003
I'm going bananas! My Access code sets up a new instance of Excel and a new
ADO connection via the following code, after I dim the variables:

Set cnt = New ADODB.Connection
Set rst = New ADODB.Recordset

cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDB & ";" & "Jet OLEDBatabase Password=XXXXX"

' Open recordset based on Orders table
rst.Open mySQL, cnt

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.workbooks.Open("G:\Path\Path2\Path3\ExcelFile.xls")
Set xlWs = xlWb.Worksheets("Data")

Then, I have code to transfer data and massage it a little bit, and then I
close my references with this:

rst.Close
cnt.Close
Set rst = Nothing
Set cnt = Nothing

' Release Excel references
Set xlWs = Nothing
Set xlWb = Nothing
Set xlApp = Nothing

But then, when I try to open those excel files to see if everything looks
OK, they are locked for editing and the instances of Excel are still open. I
end up having to use the task manager to shut them down. Where did I go
wrong ???

Richard Choate



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instances of Excel don't release Richard Choate Microsoft Excel Programming 1 26th Jun 2003 06:12 PM
Instances of Excel don't release Richard Choate Microsoft Access Macros 1 26th Jun 2003 06:12 PM
Instances of Excel don't release Richard Choate Microsoft Excel Programming 0 26th Jun 2003 06:09 PM
Instances of Excel don't release Richard Choate Microsoft Access Macros 0 26th Jun 2003 06:09 PM
Instances of Excel don't release Richard Choate Microsoft Excel Programming 0 26th Jun 2003 06:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 AM.