+ Reply to Thread
Results 1 to 12 of 12

Run Time Error

  1. #1
    Registered User
    Join Date
    06-11-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    67

    Run Time Error

    Hi,

    I'm getting a run time error on this code in Excel 03:

    Please Login or Register  to view this content.
    Huh?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Run Time Error

    I cannot Replicate the error

  3. #3
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: Run Time Error

    Try this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-11-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    67

    Re: Run Time Error

    Thanks guys.

    It takes me to debugger with that code. Maybe I have added it to the workbook incorrectly?

    The error alert window says "Run-time error '-2147467259 (80004005)': Method 'Execute' of object '_CommandBarButton' failed" if that means anything to anyone. I stupidly used command buttons, that only function in design mode, to produce a navigating workbook.

    Rather than reproduce the whole thing with autoshape buttons, I'd rather just sort this issue. It doesn't seem to affect all users so I thought it may be something to do with specific users settings, but I've come up blank!?

    Thanks again.

  5. #5
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: Run Time Error

    Please Login or Register  to view this content.
    Should be ok,,, tests here OK

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Run Time Error

    How do you get the buttons to function in design mode?

    Can you post small example of your file. It's not clear what your actual problem is.
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    06-11-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    67

    Re: Run Time Error

    Sorry for being so dippy

    An example workbook is attached.

    Jack in the UK - not sure what I need to do with that code, or are you suggesting the code I'm using works for you?

    Thanks.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: Run Time Error

    How do you get the buttons to function in design mode?
    Don’t thing you can use the buttons at run time, you can make them appear thus my code, but really you use / call the buttons code from VBA -- or i have this all wrong again

    In design view you cant do a lot

    my code runs and does what your asking,,, agreed its not really going to solve your problems however it is what you asked for without exploding

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Run Time Error

    The button only works in design mode because you appear to have a hyperlink assigned to the button.

    If you want to use the activex controls then you need to place code in the click event of the control.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-11-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    67

    Re: Run Time Error

    Thanks again.

    Seems there may not be a solution then. I have over 250 documents, all with 25 hyperlinks assigned to similar command buttons so going into each one to correct hyperlinks is not realistic. I've learnt my lesson and will never use command buttons again (damn you excel 03!), but it looks like I will have to teach users who experience this error (not very confident users mind) how to go into design mode.

    I appreciate your help, I guess this will be another one of excels little mysteries!

    Joe

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Run Time Error

    Quote Originally Posted by tuckjoseph View Post
    Thanks again.

    Seems there may not be a solution then. I have over 250 documents, all with 25 hyperlinks assigned to similar command buttons so going into each one to correct hyperlinks is not realistic. I've learnt my lesson and will never use command buttons again (damn you excel 03!), but it looks like I will have to teach users who experience this error (not very confident users mind) how to go into design mode.

    I appreciate your help, I guess this will be another one of excels little mysteries!

    Joe
    Try the buttons on the Forms toolbar instead of the Controls Toolbar, they are easier to work with.

    Press Ctrl & K to insert a HyperLink, no buttons are required.

  12. #12
    Registered User
    Join Date
    06-11-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    67

    Re: Run Time Error

    Hi Dave,

    Thanks for the heads up, I have found it easiest using AutoShapes (since creating these spreadsheets) as they behave just like a button when a macro or hyperlink is assigned them and they have more flexibility presentationally. Do you know of any differences between them and the button tool on the forms toolbar?

    I know I won't make this same mistake again, just wish I knew why I was getting this run time error!

    Joe

+ Reply to 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