Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: easy macro question

  1. #11
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You said this was gonna be an easy one!!!
    I protest!!!

  2. #12
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Mr T -

    Would it matter at all that to make this code I went to Tools>Macros then I typed in the name and pressed the 'create' button? I know when you do that the choices to save it to are personal, this workbook, and all open workbooks.

    When you go to Tools>Record Macro the choices are Personal, this workbook, and New workbook. Should I have done it there instead?? How did you do yours?

  3. #13
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Mr. T so I can duplicate what YOU did that worked, can you tell me where you created yours? Where did you store it? I know I know, I THOUGHT is was easy! The only thing I can think to do is tomorrow a.m. (I'm in Australia so we're 18 hours out from US) is write it again from scratch.

    If you can tell me where you stored yours I'll do exactly that and see what happens.

    Cheers!

  4. #14
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have been trying every which way to figure this out.
    I don't thing that re-creating the file is going to help.
    The reason it woked earlier was because the macro was connected to a button which is referenced by a sheet class module.
    The commandbar is an application level object.
    I'm getting ready to search the net for an answer.
    Probably a simple answer that will make us both sick!
    Tom

  5. #15
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Mr T Ae you insane? Don't you have anything better to do (Not that I am complaining mind you). So you think it may have something to do with...Oh God what was it? Jesus I cannot become any sicker than i am over this thing. I am beginning to feel that something in the nature of the combination of codes, toolbars and buttons just doesn't lend itself to normal operation for some reason.

    Man oh man what have I done??? Ok well listen I have to leave work now, by the way what are you doing awake isn't it about midnight in Indiana? You are truly obsessed. I will check back in the morning and I will also see what I can come up with. I know it is one of those things you're dying to know what's up and you're so right it is probably something simple but maybe, just maybe NOT and we shall have to give up on the macro mystery.

    Have a good night Mr T!

    Lauren

  6. #16
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks to Juan Pablo, we have a solution!

    This would probably work in your Auto_Open and Auto_Close macros, but why mess with it?



    Option Explicit

    Private Sub Workbook_Open()
    Dim MyCustomBar, MyCustomBarControl
    Set MyCustomBar = Application.CommandBars("SOSE Outcomes")
    Application.CommandBars("SOSE Outcomes").Enabled = True
    For Each MyCustomBarControl In MyCustomBar.Controls
    Select Case MyCustomBarControl.Caption
    Case "Paste to My Class"
    MyCustomBarControl.OnAction = "SOSECutPaste"
    Case "4 outcomes per page"
    MyCustomBarControl.OnAction = "RH90"
    Case "3 outcomes per page"
    MyCustomBarControl.OnAction = "RH120"
    End Select
    Next
    Application.CommandBars("SOSE Outcomes").Visible = True
    End Sub

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars("SOSE Outcomes").Visible = False
    Application.CommandBars("SOSE Outcomes").Enabled = False
    End Sub



    Send a thanks to Juan next time your on the board.
    Tom

    P.S.
    I was advised by Juan to create your custom bars on the fly and then destroy them when the workbook closes.

    [ This Message was edited by: TsTom on 2002-05-12 23:54 ]

  7. #17
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Chookers.

    In your last thread I basically gave you the
    answer that Tom has come up with.
    If you look here you will see;

    http://www.mrexcel.com/board/viewtop...c=7707&forum=2

    Might pay to read the entire thread before
    going off on another

    Kind Regards,
    Ivan F Moala From the City of Sails

Some videos you may like

User Tag List

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
  •