+ Reply to Thread
Results 1 to 6 of 6

Active X Command Button causes Excel to crash

  1. #1
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Active X Command Button causes Excel to crash

    Hi,
    i have 4 active X buttons on a sheet, all work okay apart from 1.
    this is the code
    Please Login or Register  to view this content.
    on clicking the button it causes Excel to crash and restart.

    i have tried assigning the code to a sub and then call that from the button and it works ok

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Any ideas?
    I have tried deleting the button and adding a new one but it still happens.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  2. #2
    Registered User
    Join Date
    04-03-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    75

    Re: Active X Command Button causes Excel to crash

    This MAY be related to a known issue that arose after microsoft released an update. Try going to C:\Users\[user name]\AppData\Local\Temp\Word8.0 and C:\Users\[user name]\AppData\Local\Temp\Excel8.0 and in both cases find the file called "MSForms.exd" and delete.

  3. #3
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Active X Command Button causes Excel to crash

    Thanks but that issue caused active x buttons not to work. The buttons work fine but it just crashes if the code is within the command_click sub.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Active X Command Button causes Excel to crash

    Hello Sean Thomas,

    Since this is an API related problem, I will need to see your all of your code.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Active X Command Button causes Excel to crash

    Hi Leith, unfortunately it is work related and highly confidential so I can't upload the workbook. All the API code etc works fine if I run the rungetdatafromwindows procedure. But it crashes if I build the code into the button sub. I also had a problem with the workbook_open sub, it failed on sheet4.unprotect. I had to delete that line and rewrite it to clear the fault. I'm wondering if the workbook has been corrupted as the command_click should not cause this error.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Active X Command Button causes Excel to crash

    Hello Sean Thomas,

    Sorry to hear that. I really need to review all of the code to find the problem. The Windows API is very complex and it is easy to make a mistake when using it. Without being able to review the code in it's entirety, I can help you troubleshoot this.

+ 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. Using an Active X Command Button
    By Scottmcq12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2014, 05:04 AM
  2. How to dissable active X command button on sheet
    By GavJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2013, 07:09 AM
  3. [SOLVED] Active Command Button Properties
    By Usethaschwarz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-15-2012, 08:47 AM
  4. Tab sequence from cell to active x button and then to a command button
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2009, 02:27 PM
  5. Printing Active Sheet with command button
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2007, 03:53 AM

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