+ Reply to Thread
Results 1 to 5 of 5

Close Connection to Access

  1. #1
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Close Connection to Access

    Hi all,

    I need help for a real difficult problem. In my Excel sheet I get Data via macro from an Access File. Sometimes a query is the source and sometimes a table. Everything is working fine.

    The Problem is, as long as I have opened the Excel File, I can't edit the Access Database (read-only). If I want to make changes in the Access file, I have to close the Excel File, since that means closing the connection to Excel.

    The question is: How can I close the connection to Excel with VBA without closing the complete Excel file? Reason being is that other people can work with the Access File while the Excel File is still open.

    Can someone help?


    BTW:

    That's how the code which retrieves the data from Access looks like:

    Please Login or Register  to view this content.
    Last edited by Minder; 06-02-2009 at 06:01 AM.

  2. #2
    Registered User
    Join Date
    05-22-2009
    Location
    UK
    MS-Off Ver
    Excel 2000,2003 and regretably 2007
    Posts
    77

    Re: Close Connection to Access

    Minder,

    Try adding
    Please Login or Register  to view this content.
    i think this will prevent you from having to even close the connection as your connection via excel will be come read only

    Teshi...

  3. #3
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Close Connection to Access

    Alright. Sorry about that.

  4. #4
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Close Connection to Access

    Thanks Teshi. Actually it did not sound bad. Unfortunately it does not work. I added

    Please Login or Register  to view this content.
    to my code.
    The Query is running fine but I still get read only to my Access File while the Excel File is opened.

    This problem drives me crazy

  5. #5
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Close Connection to Access

    I found the solution.

    The code from the macro recorder included

    Please Login or Register  to view this content.
    After deleting that part I can write in my Access Database while Excel is open

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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