+ Reply to Thread
Results 1 to 9 of 9

Excel Not Responding after running Save and Close Macro Button

  1. #1
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Excel Not Responding after running Save and Close Macro Button

    Dear All,
    Please help for this....
    Attached Files Attached Files
    Don`t care, take care...

    Regards,
    Mangesh

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel Not Responding after running Save and Close Macro Button

    Can't recreate the problem, here - it simply closes the active workbook.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel Not Responding after running Save and Close Macro Button

    Quote Originally Posted by ExcelGoose View Post
    Mangesh, I will need to look at this further however judging from the preliminary stages it looks like this could be due to the code.

    Goose


    This is all the code is:
    Please Login or Register  to view this content.
    Nothing there that causes excel to hang... It doesn't even SAVE the workbook, just closes it, so the name is misleading!

  4. #4
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Excel Not Responding after running Save and Close Macro Button

    I don`t know why but at my end its not responding after pressing button, but when I am saving and closing manually its not showing any error..

    Ya.. I have removed the code Save= True... for checking

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel Not Responding after running Save and Close Macro Button

    Quote Originally Posted by ExcelGoose View Post
    Hi Olly,

    Where in that line of code have you told it to save? You are telling the workbook to close (not even the application).

    sub CloseAndSave()

    Activeworkbook.saveas Filename:="filepath" & "/" & "Name" & ".xls"
    Activeworkbook.close, false

    end sub


    Goose
    We're trying to figure out why the OP is experiencing excel hanging, with his sample workbook. The code he is using is what I posted, and I can't see any thing in his code which may cause Excel to hang or crash.

  6. #6
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Excel Not Responding after running Save and Close Macro Button

    Hii Olly and Goose I have just checked using normal Form control button with same code instead of Shapes with this its not hanging... So what should I have to do to use Shape instead of Normal Form Control button??...

  7. #7
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Excel Not Responding after running Save and Close Macro Button

    Its not the code, it is the problem of "Shape" I am using to assign a macro.. I have saved my workbook in Compatibility mode...

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel Not Responding after running Save and Close Macro Button

    Again, I can't see where the problem is. Your attached workbook works exactly as it should - the macro assigned to the shape object fires when clicked, and closes the activeworkbook.


  9. #9
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Excel Not Responding after running Save and Close Macro Button

    yes i have attached correct workbook
    Attached Images Attached Images
    Attached Files Attached Files

+ 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. Macro to turn off save box when user click close button
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-22-2016, 07:43 AM
  2. Replies: 1
    Last Post: 01-31-2016, 05:54 AM
  3. Excel not responding when the running macro doesw not find the right session
    By DDarocha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-06-2015, 08:57 AM
  4. Excel and Outlook become "NOT RESPONDING" when running Macro
    By g1987 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2012, 03:28 PM
  5. Save and Close Button on an excel userfom
    By Ruis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-05-2010, 06:30 PM
  6. [SOLVED] running macro at save/close/exit
    By Pedro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 08:40 AM
  7. excel close + save by button press. how?
    By tomro1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2006, 06:45 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