+ Reply to Thread
Results 1 to 12 of 12

Simple VBA Macro freezing computer

  1. #1
    Registered User
    Join Date
    06-09-2008
    Posts
    24

    Simple VBA Macro freezing computer

    Hello. I created some simple VBA macro buttons to help navigate around a sheet within a .xlsm file I have. I have about 10 different macro buttons that do this, and simply jump to a different cell in the sheet. Here's an example:

    Sub goto_section1()
    'Select the section to jump to
    Range("A141").Select
    'Make the selected cell the first row
    ActiveWindow.ScrollRow = ActiveCell.Row
    End Sub

    These have worked flawlessly, but recently, every once in awhile a click of one of these buttons will freeze my computer. Basically, the "processing circle" appears as my cursor, it says "Excel is not responding" and I can't even click anything on my computer desktop, taskbar, etc. I can't even pull up the Task Manager to terminate Excel. Nothing works, and I must hard reboot my computer.

    Sometimes this happens and sometimes it does not. I'd say it's become about 25% chance of happening now. Here is some more information:
    - The file size is less than 1MB
    - All VBA code is under Module1 in VBA
    - The file is located on a shared drive in our office
    - I included an image I took a picture of (since I couldn't screenshot when it froze!)

    Any help/feedback is appreciated!
    Attached Images Attached Images

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,343

    Re: Simple VBA Macro freezing computer

    What if you try this one?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    06-09-2008
    Posts
    24

    Re: Simple VBA Macro freezing computer

    Hello. I tried your selection but it still happens. The strange thing is, it doesn't always happen. If the macro buttons work once when I have the file open, they work the entire time I am using the file (in that instance). If another day I open the file and use the buttons, the first time I click a button, it freezes (as mentioned in the previous post). So, there's something weird with how the file is open on my PC, and probably not the macro (I assume). Any other thoughts? Any settings/addins/etc that could be causing this? I'm perplexed...

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Simple VBA Macro freezing computer

    why not use hyperlink instead of vba?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Simple VBA Macro freezing computer

    Any other code?

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    06-09-2008
    Posts
    24

    Re: Simple VBA Macro freezing computer

    Hey guys. Thanks so much for the quick replies.

    why not use hyperlink instead of vba?
    Because this file is used for monthly planning, so as I plan the next month, I copy/pastecopy a new tab and rename to the new month. With hyperlinks, the links would jump me back to the previous tab. With the macros, the cell references do not include the sheet name, so they stay intact.

    Any other code?
    No other code. However, there are several named ranges (but I don't see why that would cause any issue).

    Any chance you could upload a sample workbook?
    I did by best to simplify the file to show what I have. I attached it.

    Also, I do feel it has something to do with the Shared Drive. It's stored on an office Shared Drive, and has links to another file on the same drive (same folder too). I feel this issue occurs more often when I am using the file at home and accessing the file through our VPN. HOWEVER, it has happened to me while in the office as well, so that can't be the sole cause (if at all).
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Simple VBA Macro freezing computer

    fair enough about updating of hyperlinks but hyperlinks are fairly easy to update with regards to this
    Please Login or Register  to view this content.
    as a bonus you wont need to share as XLSM file

    this aside, dont see anything wrong with the example and/or code itself...it probably is something else in the "real" file you have

  8. #8
    Registered User
    Join Date
    06-09-2008
    Posts
    24

    Re: Simple VBA Macro freezing computer

    What still perplexes me is that it happens sometimes and it doesn't happen sometimes. As for the real file, consider there being 10 more buttons with the same code and 10 more named ranges. Other than formulas and links to another file, that's it.

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Simple VBA Macro freezing computer

    Other than formulas and links to another file
    is the other files open when it freezes?

  10. #10
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Simple VBA Macro freezing computer

    If no solution works, try to do a full repair on your Microsoft Office install.

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Simple VBA Macro freezing computer

    Office 2013 by any chance?
    It happens to me every so once in a while.
    Make sure to save your work regularly while working on it.

  12. #12
    Registered User
    Join Date
    06-09-2008
    Posts
    24

    Re: Simple VBA Macro freezing computer

    is the other files open when it freezes?
    Yes.

    If no solution works, try to do a full repair on your Microsoft Office install.
    I have recently done this, and I still at times experience the same issue.

    Office 2013 by any chance?
    It happens to me every so once in a while.
    Make sure to save your work regularly while working on it.
    It is Microsoft Office 365 ProPlus. We had it upgraded within the past year. I am not positive, but it is possible this problem only started after the upgrade.

+ 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. How to design a simple guessing game, played by one player against the computer.
    By Papsco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2015, 10:40 PM
  2. macro freezing - too many words?
    By labmanager in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-27-2013, 03:01 PM
  3. coin toss programme for MS Excel
    By mayf92 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 09:27 AM
  4. macro keeps freezing
    By theinexplicablefuzz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2011, 03:15 PM
  5. Macro freezing sheet on one pc
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2009, 08:21 AM
  6. Auto Filter on my home computer differs from my work computer.
    By Sbova0226 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-08-2009, 03:04 PM
  7. Why is Computer Freezing With Excel?
    By heitorfjr in forum Excel General
    Replies: 1
    Last Post: 01-15-2006, 01:16 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