Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Excel instance isolation problem

Excel 2003, sp2


Hi,

I'm using an add-in to create a report. The report is put together with data
from a few named ranges in a hidden excel worksheet. Below is the relevant
code that's in a standard module in the add-in.


Dim wkbData As Excel.Workbook
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Dim sFileConnectionString As String
Dim sFilePath As String

Set wkbData = ActiveWorkbook

sFilePath = wkbData.FullName

sFileConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sFilePath & ";Extended Properties=""Excel
8.0;HDR=Yes"";"

Set cn = New ADODB.Connection
cn.Open (sFileConnectionString)

Set rs = New ADODB.Recordset

... more code to generate report



Everything works fine as long as I use 1 instance of Excel. As soon as I
have two instances (each with a copy of the data workbook) "cn.Open
(sFileConnectionString)" opens a copy of sFilePath in the 2nd instance in
read-only mode. After that the code starts to mix the data from the two
workbooks.
Isn't each Excel instance isolated from all other instances?

Any ideas?
Pete


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
Excel - New Instance JMay Excel Discussion (Misc queries) 4 November 28th 09 04:55 PM
How do I get one instance of Excel to communicate with another instance? [email protected] Excel Programming 3 November 21st 06 10:31 PM
Can you recalculate an individual excel cell in isolation? Dobey Kweeg Excel Worksheet Functions 2 November 21st 05 01:48 PM
problem with macro opening second instance Bob Wenner Excel Programming 1 May 18th 04 09:04 PM
Excel Instance FuzzyLogic Excel Programming 2 February 21st 04 03:41 PM


All times are GMT +1. The time now is 06:48 AM.

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

About Us

"It's about Microsoft Excel"