Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 57

Thread: How to preserve or regain the Id of my custom ribbon UI?

  1. #21
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Yes, actually I do use the same routine name in all of my applications. But the people who have reported this problem have none of my other addins or applications loaded... I assume you are going to suggest that I rename the procedure, in order to prevent the possibility of a cross-call. It wouldn;t hurt.
    (XL2010 on Windows 7 Professional SP 2)

  2. #22
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,714
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    4 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Yep - see Ken's blog here.

  3. #23
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Ahh, I seem to remember stumblng upon this article a couple of years ago, when I had a conflict with applications built by a co-worker. Thanx for pointing me back to it.

    I'll make the routine name change, and also working on some more graceful error handling, for the belt and suspenders approach...
    (XL2010 on Windows 7 Professional SP 2)

  4. #24
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Hmm, looks like I already changed the name of this so it is already unique. I suppose that someone could have stolen my code since I made the name change last year, thus creating the conflict I was trying to avoid when I originally changed the name. I'm not 100% convinced this is the root cause... but combined with my other fixes, I think this'll put the last nail in the coffin.

    Thanx Rory.
    (XL2010 on Windows 7 Professional SP 2)

  5. #25
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,714
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    4 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    No worries. Please post back if you find out the problem.

  6. #26
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    I just stumbled on this again. On my own machine for the first time. It seems that the ****** routine was called and worked fine. But after having this file open on my machine for several hours, and swapping back and forth to other workbooks in the same application session, suddenly my error handler triggered. On closer investigation, the global named range where I was storing the pointer had a value of ZERO. I am still trying to figure out why. I have exactly (2) lines of code in the entire project that reset this to ZERO. 1) In an admin routine that I run before I dsitribute new versions of the file which clears all data and resets all workbook resdient settings to nominal, and 2) In the workbook open event, to prevent my error handler from triggering before the ribbon loads, in case I forgot to run the admin routine to clear all values before closing the workbook. The admin routine did not get tiggered, because none of the other values in the file had been reset. I don;t see how the workbook open event got triggered.

    So now I see that the pointer was properly captured and stored in the ****** event... but am perplexed how this global named range got set to a value of ZERO at some later time. The investigation continues.
    (XL2010 on Windows 7 Professional SP 2)

  7. #27
    Board Regular Jaafar Tribak's Avatar
    Join Date
    Dec 2002
    Location
    Larache--Morocco
    Posts
    6,861
    Post Thanks / Like
    Mentioned
    13 Post(s)
    Tagged
    2 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Quote Originally Posted by hatman View Post
    I just stumbled on this again. On my own machine for the first time. It seems that the ****** routine was called and worked fine. But after having this file open on my machine for several hours, and swapping back and forth to other workbooks in the same application session, suddenly my error handler triggered. On closer investigation, the global named range where I was storing the pointer had a value of ZERO. I am still trying to figure out why. I have exactly (2) lines of code in the entire project that reset this to ZERO. 1) In an admin routine that I run before I dsitribute new versions of the file which clears all data and resets all workbook resdient settings to nominal, and 2) In the workbook open event, to prevent my error handler from triggering before the ribbon loads, in case I forgot to run the admin routine to clear all values before closing the workbook. The admin routine did not get tiggered, because none of the other values in the file had been reset. I don;t see how the workbook open event got triggered.

    So now I see that the pointer was properly captured and stored in the ****** event... but am perplexed how this global named range got set to a value of ZERO at some later time. The investigation continues.
    Just taking a wild guess at this. Try storing the pointer in other than a name like in a cell , the registry, a window Property... etc and see if it resolves the issue.
    Office/Excel 2010 64Bits -- Win10 64Bits

    Common sense is not so common.


    http://photo-larache.blogspot.com/

  8. #28
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    Thanx Jaafar. I thought of that. I'm not sure what differnce it will make, but I agree, it's worth a shot, considering that there really aren't a lot of code changes required.

    Another thought I had was to reduce my "opportunities" by half and remove the line of code that resets the value to ZERO in the Open event. It's really there to avoid the occassional nuisance cases during developement where I save the workbook with data in it, close it and re-open it with the OLD ribbon pointer still persisting from the previous session.

    It'll be a few weeks before I distribute the next version of the application... so I won;t be able to evaluate any of this for a while...
    (XL2010 on Windows 7 Professional SP 2)

  9. #29
    Board Regular hatman's Avatar
    Join Date
    Apr 2005
    Location
    Palmer, MA
    Posts
    2,662
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    So I distributed new code last week. Included is a routine that logs errors to a central log file. I have had 6 occurances of the error, always in the same sub-routine. It would be nice if there was runtieme access to the Call Stack using VBA code, so I could get a sens of how the code execution arrived at this point for each error. But at least the search is being focused. The dilemma goes on.
    (XL2010 on Windows 7 Professional SP 2)

  10. #30
    Board Regular
    Join Date
    Jul 2006
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to preserve or regain the Id of my custom ribbon UI?

    been hunting all morning for a clue why attempting to invalidate a Custom UI gives me "object variable or with block variable blah-de-blah-blah".

    boy do I feel like an amateur reading this.

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
  •