+ Reply to Thread
Results 1 to 6 of 6

Couldn't open excel file when data connection file is open!!

  1. #1
    Registered User
    Join Date
    01-30-2018
    Location
    Columbus OH, U.S
    MS-Off Ver
    2003-2007
    Posts
    3

    Post Couldn't open excel file when data connection file is open!!

    I'm creating an excel data connection of a release log, which will be will be kept open 24/7 displayed remotely and refreshes automatically every 5 minutes so it can display the latest info entered in to the original excel file (release log). Everything is working fine except I'm facing the problem when I need to open the original excel file it gives a message "file locked by another user" and can be only opened in read-only mode which doen's help for the purpose. I found that this problem occurs after the data connection is refreshed. Can anyone please tell if there is a way to overcome this issue?. All I wanted is to be able to open the original excel file any time I wanted, enter the data, save and close it without interfering the data connection file. Thanks in advance for your help!!

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Couldn't open excel file when data connection file is open!!

    Just use code to make connection every five minutes and check if file is open and wait until it's closed.

    Query result, and close connection.

    Or use ADO to control everything from data entry to querying. Use INSERT INTO, UPDATE etc.

    But Excel isn't really meant to be used as database.

    It's much more preferable to use database for this sort of thing. Such as Access, mySQL, SQL Express etc.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    01-30-2018
    Location
    Columbus OH, U.S
    MS-Off Ver
    2003-2007
    Posts
    3

    Re: Couldn't open excel file when data connection file is open!!

    Excel_Error_msg.PNG

    I got this error message when I refresh data connection on different computer. Any idea how to fix this?
    Thanks!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Couldn't open excel file when data connection file is open!!

    If Auto-Filter is applied to data source, it can cause this issue. Check and see if removing this will fix the issue?
    Basically, Excel creates hidden internal object to store filter information. These shouldn't be available normally, but when connector tries to retrieve worksheet names, these can appear and may cause issues.

    And how exactly are you trying to bring in info? MSQuery, PowerQuery, other data connection etc?

  5. #5
    Registered User
    Join Date
    01-30-2018
    Location
    Columbus OH, U.S
    MS-Off Ver
    2003-2007
    Posts
    3

    Re: Couldn't open excel file when data connection file is open!!

    Thank you so much for your reply.
    To answer your question, I'm using (.dqy)Microsoft Office Excel ODBC Query file which was created from an excel file. But one thing is weird that the data connection is working fine with no error on my computer but giving this error when I open other computer on the same network where actually I will have this data connection file will be kept open 24/7.
    Last edited by srinir; 02-01-2018 at 10:56 AM.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Couldn't open excel file when data connection file is open!!

    Ok, so it's MSQuery based. You could also set option to remove system tables.

+ 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: 05-15-2015, 04:12 PM
  2. run a sql file on a connection open in excel
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-24-2014, 09:55 AM
  3. [SOLVED] Workbooks.Open method and runtime error 1004 - "file couldn't be found".
    By PHBlaz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-28-2014, 02:10 PM
  4. A file iis found if I open Excel FIRST, but not if I open the file by double-clicking
    By Ed_Collins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2013, 01:52 AM
  5. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  6. VBA for excel 2003. Open file dialog box, open 2007 file xlsx, continue with code
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2011, 12:12 AM
  7. Replies: 1
    Last Post: 12-21-2005, 12:10 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