+ Reply to Thread
Results 1 to 6 of 6

workbook.close causing program to "hang-up"

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    workbook.close causing program to "hang-up"

    Hi,

    I have a macro where i am opening a file , processing the file then closing the file.

    For some reason when i execute the close file operation the program hangs up. I have to press cntrl+alt+delete to stop macro.

    Any ideas?

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: workbook.close causing program to "hang-up"

    You might want to include the workbook as an attachment, or at minimum the procedure that the .close method is hanging up in. Otherwise we're just guessing.


    Speaking of guess... have you qualified which workbook you're trying to close? Such as:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 08-26-2013 at 10:10 AM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: workbook.close causing program to "hang-up"

    hi XeRo Solus,

    I have used this in other applications

    Please Login or Register  to view this content.
    where fl_nm_to_open is a string which contains the file name.

    I seem to have run into this before.........i seem to recall something about clearing clipboard. I did a search on my old posts but could not find anything.

  4. #4
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: workbook.close causing program to "hang-up"

    hi XeRo Solus,

    Upon further review it might be something not related to the .close operation.........having something "strange" going on. I thought it was due to .close operation but now i am not sure.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: workbook.close causing program to "hang-up"

    Hang Up could mean the code is running very very slow and when you try to close it by forcing it, it will crash and you get an error. To find out why the code is running slow is: Run the code step by step by pressing F8 and step over each line and see in which line of the code hangs up.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: workbook.close causing program to "hang-up"

    Also, try workbooks(wb.name).close instead of the full path.

+ 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. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  2. [SOLVED] "not enough memory" error on workbook.save , but not .close(SaveChanges:=True)
    By sylvainsylvain in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2013, 12:08 PM
  3. "personal macro workbook" not loaded when Excel started by other program
    By nleahcim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2012, 02:46 AM
  4. [SOLVED] Excel 2003 not responding to "X" to close program
    By Barb Widman - Norwalk City Schools in forum Excel General
    Replies: 1
    Last Post: 05-17-2006, 01:40 PM
  5. Replies: 1
    Last Post: 01-30-2006, 06:10 PM

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