+ Reply to Thread
Results 1 to 7 of 7

Excel workbook won't close when using 'close' command

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Excel workbook won't close when using 'close' command

    Hello,

    I have an excel application (xlsm) and a database file (xlsx).
    I open/close the xlsx file from the xlsm file - using open/close file and run queries using connection.
    The xlsx file is located on a server and multiple users are connecting it.

    In some computers the xlsx won't close.
    I noticed it when I finished working with my xlsm file and intended to work with different excel file.

    What can cause this ?
    How can I insure the file is closed after close command ?

    I am using the following code to open and close the workook:
    Call OpenFileXLS(DBWorkbookName, DBWorkbookPath, "write")
    Set TargetWorkbook = ActiveWorkbook
    ...
    TargetWorkbook.Close saveChanges:=True


    Thank you for your help
    Last edited by Snoopy2003; 03-21-2012 at 07:58 PM.

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Excel file won't close

    Try with:

    Please Login or Register  to view this content.
    I hope that helps.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Excel file won't close

    There are two types of shared Excel files, those that are corrupted, and those that soon will be ... use Access, or similar, to avoid this problem.

  4. #4
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Excel file won't close

    Hello,

    Pichingualas - Thank you. I will try it and tell you if it works.

    Marcol -
    Do You mean to use excel as front-end and access as back-end DB ?
    Can the user use access run time if he does not have access software ?
    Can you recommend on an example in order to learn how to do it ?

    Thank you for your time and help

  5. #5
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Excel file won't close

    Hello,

    Pichingualas - Thank you. You solved my problem.

    Thank you for your support

  6. #6
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Excel file won't close

    Glad to help

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel file won't close

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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