Closed Thread
Results 1 to 9 of 9

Assigning Macro to shape in 2007 - Crash!

  1. #1
    Registered User
    Join Date
    03-13-2007
    Location
    Metro Atlanta
    Posts
    48

    Assigning Macro to shape in 2007 - Crash!

    I posted similar yesterday. No one helped...sniff sniff (where's the crying smily)

    Now verified to be occur on other machines running various versions of Office 2007...

    In Excel 2007, write this simple macro and assign it to a shape:

    Please Login or Register  to view this content.
    My experience: Selecting shape to run macro crashes Excel. But if I just run it from the Macros dialog box or from the VB Module, it does not crash.

    Is there something else special I need to do in 2007 to assign a Macro to a shape???

    Do you have the same experience?

    Thanks,
    Ernie

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431
    Can you post an example so we can see where the code is place and what shape you have used.

    Are you using xl2007 SP1
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-13-2007
    Location
    Metro Atlanta
    Posts
    48
    Ok. Here it is. Thanks.
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431
    Your test file does not crash for me.
    But I will also test when I'm back at work on Monday.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431
    I can now reproduce the problem. It is a known bug.

    Have a read of this page
    http://www.rondebruin.nl/shape.htm

  6. #6
    Registered User
    Join Date
    03-13-2007
    Location
    Metro Atlanta
    Posts
    48
    Andy,

    Thanks man! That's the solution!

    Ernie

  7. #7
    Registered User
    Join Date
    03-13-2007
    Location
    Metro Atlanta
    Posts
    48

    Re: Assigning Macro to shape in 2007 - Crash!

    I've also learned that if your macro ends in Thisworkbook.close and also closes other workbooks, put the macro in the other workbook and refer to it. It's not a consistent crash closing other workbooks, but it happens!

  8. #8
    Registered User
    Join Date
    06-12-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010 (Windows) Excel 2011 (Mac)
    Posts
    30

    Re: Assigning Macro to shape in 2007 - Crash!

    I have the same problem with a piece of code that is connected to a button in Excel 2010. The RonDeBruin code doesn't solve this however. What to do?

    My code is used to simply select another sheet

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Assigning Macro to shape in 2007 - Crash!

    Jongering,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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