+ Reply to Thread
Results 1 to 5 of 5

error when trying to refresh data from excel

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Beirut
    MS-Off Ver
    Excel 2010
    Posts
    21

    error when trying to refresh data from excel

    Hi all,

    I have an excel file which is connected to more than one query from an access file.I recently added 3 queries and tried to refresh the data from the excel file, but I am getting the following message :
    Couldn't use <filename>; file already in use

    Note tha I can refresh all the old queries anf if I try to refresh the new ones I get this message and the same happens in case I refresh the new ones then I try to refresh the old one.

    Excel and Access file are located on the same computer. I am using Excel 2010 and Access 2003
    Access is linked to tables based on SQL.

    When I try to refresh my excel , I make sure that access is not running at all.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: error when trying to refresh data from excel

    You CANT have the excel file open (in Excel) while Access is trying to read it.
    Close Excel.

  3. #3
    Registered User
    Join Date
    01-06-2014
    Location
    Beirut
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: error when trying to refresh data from excel

    I am refreshing the excel sheet to retrieve data from access queries (access is already closed)

  4. #4
    Registered User
    Join Date
    10-21-2014
    Location
    Derby, England
    MS-Off Ver
    2010
    Posts
    15

    Re: error when trying to refresh data from excel

    Sounds like the new queries you have created may be accessing your old queries recordset?

    For instance, if you have a SELECT query that uses another SELECT query as it's data source.

    This isn't something I've come across or tested, but sounds like the only plausible explanation if you do actually have the Access file closed when refreshing Excel data...

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: error when trying to refresh data from excel

    Once you open the connection , you also need to close it .

    If your code is trying to open a connection that is already open from the code then you might get this issue.

    Best practice is :

    Open the connection to the db.
    Query the db.
    Close the db.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 09-29-2013, 06:15 AM
  2. Replies: 1
    Last Post: 09-28-2013, 07:11 PM
  3. Refresh Data gives shut down error
    By DPU in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2008, 04:41 PM
  4. [SOLVED] Pivot Table Refresh error "Problems Obtaining Data"
    By rcl in forum Excel General
    Replies: 0
    Last Post: 04-10-2006, 05:50 PM
  5. [SOLVED] Pivot Table Data Refresh error after upgrade from 2000 to 2003
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-04-2005, 06:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1