Results 1 to 10 of 10

Thread: Excel closes automatically

  1. #1
    Board Regular
    Join Date
    Jul 2018
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Excel closes automatically

    I have a new desktop computer and since I started using it any Excel file with a macro will run the script and then just close Excel. There are no errors, nor does it matter which Excel workbook I use. These previously worked fine on a different computer, and other colleagues are able to use the files as they always have. Is there a setting on my new computer or do I need to run Office Repair?

  2. #2
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    461
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    Quote Originally Posted by WxShady13 View Post
    any Excel file with a macro will run the script and then just close Excel.
    is there a personal workbook macro?
    can you post an example of any code you are running?
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

  3. #3
    Board Regular
    Join Date
    Jul 2018
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    Quote Originally Posted by BlakeSkate View Post
    is there a personal workbook macro?
    can you post an example of any code you are running?
    The macro's are only used specifically for the workbooks and they are all different in each workbook. Each workbook that I have tried has unique macro's and the code is different.

  4. #4
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    461
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    okay well no on can help you if you don't give more information

    perhaps include: your version of excel/office, what version of windows you are using, if these are fresh installations or the computer came with them.
    an example of a code you run that closes excel.
    or perhaps you have a personal macro workbook you didn't know you had that has a sheet enabled vba code or similar function
    you can check here on how to find it

    or you can just run office repair and pray that it solves your problem
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

  5. #5
    Board Regular
    Join Date
    Jul 2018
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    I am using Office 365 Excel

    Here s an example of the first macro that is launched.

    Code:
    Sub CopyTable()
    Application.ScreenUpdating = False
    Sheets("SHMM Sections").Unprotect Password:="-----"
    'Worksheets("SHMM Sections").Range("A3:CS200").ClearContents
    With Worksheets("SHMM Sections").ListObjects("Table4")
            If Not .DataBodyRange Is Nothing Then
                .DataBodyRange.Delete
            End If
        End With
    
    Dim LastRow As Long
    LastRow = Range("A" & Rows.Count).End(xlUp).Row
    Call CBTModuleClear
    Worksheets("Sign-In Sheet").Range("A7:D" & LastRow).Copy
    Worksheets("SHMM Sections").Range("A3:CS" & LastRow).PasteSpecial xlPasteValues
    Worksheets("CBT Modules").Range("A2:D" & LastRow).PasteSpecial xlPasteValues
    'Worksheets("SHMM Sections").Range("A3").PasteSpecial = xlPasteValues
    Call IFStatements
    Call CBTIfStatements
    Sheets("SHMM Sections").Protect Password:="-------"
    Application.ScreenUpdating = True
    End Sub
    Thiscode sta

  6. #6
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    461
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    Quote Originally Posted by WxShady13 View Post
    I am using Office 365 Excel

    Here s an example of the first macro that is launched.
    if this first macro exits excel then go through your macros
    "CBTModuleClear, IFStatements, and CBTIfStatements
    and check for the keywords using the ctrl + f find function
    ".Quit" , "Application", ".Close"

    note that case sensisitvity and whole word only should be unchecked.
    you can also check the "Current Project" search radio button

    try also looking in your microsoft excel objects > ThisWorkbook as well as microsoft excel objects > Sheet(whichever one is relevant) in the Microsoft Visual Basic editor screen
    any codes there?

    also any update on if you have a macro workbook?
    Last edited by BlakeSkate; Aug 21st, 2019 at 02:20 PM.
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

  7. #7
    Board Regular
    Join Date
    Jul 2018
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    It is saved as a macro workbook (.xlsm)

    Thank you let me go check the code.

  8. #8
    Board Regular
    Join Date
    Jul 2018
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    I went through the workbook & macros and there is no code telling it to close. Also on all the other machines it does not close automatically.

  9. #9
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,743
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel closes automatically

    You still haven't answered BlakeSkate's question about whether or not you have a Personal Macro Workbook on your computer.
    These macros would NOT be found in the workbook you are talking about, but would be available to you at all times when you have Excel open.
    See: https://trumpexcel.com/person-macro-workbook/

    The easiest way to see if you do is to close out of all open Excel workbooks, except for this one that you are working on.
    Then, go into the VB Editor, and bring up the Project Explorer (View -> Project Explorer).
    How many VBAProjects does it show? Does it list one named VBAProject (PERSONAL.XLSB)?
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  10. #10
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    461
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel closes automatically

    the only thing i can think of BESIDES a personal macro workbook is if you have an an excel addin that is corrupt. You could try to uninstall and reinstalling any addons you have installed to this pc.
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •