View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Serge L Serge L is offline
external usenet poster
 
Posts: 2
Default Excel ADO connection opens read-only instance of opened Excel

ok here is my code from example on microsoft website
( http://support.microsoft.com/default.aspx?scid=kb;EN-
US;Q321686 )

With gxlCN
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & xlPath & ";" & _
"Extended Properties=""Excel 8.0; HDR=Yes;"" "
.Open
End With

PROBLEM SCENARIO:
2 separate Excel applications are open
1 create connection in one Excel instance -
Connection's creates fine, but the second instance of
Excel now has read-only-instance of first excel app. If I
finish running the code and close both Excel apps, Task
Manager shows instance of Excel running in the memory.

I terminate my connection object like this
If gxlCN Is Nothing = False Then
If gxlCN.State = adStateOpen Then gxlCN.Close
Set gxlCN = Nothing
End If

Please help me open Excel ADO connection without this read-
only copy.

Thank you

Serge