Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IoleUndoManager with Excel application

IoleUndoManager with Excel application

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++comdata-structures
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jaafar tribak
    wrote on last edited by
    #1

    Hi all, First of all, I would like to apologize for posting this question in the C++ forum as it deals with Classic VB (VBA) ... The reason I posted here is because I can't get an answer (not even a hint) in the VB/VBA foums ... I searched the web extensively but without any luck I hope you guys can ,at least, point me in the right direction Problem: I am trying to control the Undo/Redo Stack in excel but I can't seem to get a pointer to the UndoManager Interface in the ppv out argument when calling the QueryService Method .. it always returns Nothing .. I hope someone can tell me what I am doing wrong .. I think the "SID_SApplicationObject" is not the right SID for what I am trying to achieve Note : I am using the olelib.tlb Code :

    Sub Test()
    Dim pUnk As olelib.IUnknown
    Dim IServiceProvider As olelib.IServiceProvider
    Dim IID_IServiceProvider As olelib.UUID
    Dim IID_IOleUndoManager As olelib.UUID
    Dim SID_SApplicationObject As olelib.UUID
    Dim ppv As IUnknown
    CLSIDFromString IIDSTR_IServiceProvider, IID_IServiceProvider
    CLSIDFromString "{0C539790-12E4-11CF-B661-00AA004CD6D8}", SID_SApplicationObject
    Set pUnk = Excel.Application
    pUnk.QueryInterface IID_IServiceProvider, IServiceProvider
    IServiceProvider.QueryService SID_SApplicationObject, IID_IOleUndoManager, ppv
    End Sub

    Any help will be much appreciated Regards.

    D 1 Reply Last reply
    0
    • J jaafar tribak

      Hi all, First of all, I would like to apologize for posting this question in the C++ forum as it deals with Classic VB (VBA) ... The reason I posted here is because I can't get an answer (not even a hint) in the VB/VBA foums ... I searched the web extensively but without any luck I hope you guys can ,at least, point me in the right direction Problem: I am trying to control the Undo/Redo Stack in excel but I can't seem to get a pointer to the UndoManager Interface in the ppv out argument when calling the QueryService Method .. it always returns Nothing .. I hope someone can tell me what I am doing wrong .. I think the "SID_SApplicationObject" is not the right SID for what I am trying to achieve Note : I am using the olelib.tlb Code :

      Sub Test()
      Dim pUnk As olelib.IUnknown
      Dim IServiceProvider As olelib.IServiceProvider
      Dim IID_IServiceProvider As olelib.UUID
      Dim IID_IOleUndoManager As olelib.UUID
      Dim SID_SApplicationObject As olelib.UUID
      Dim ppv As IUnknown
      CLSIDFromString IIDSTR_IServiceProvider, IID_IServiceProvider
      CLSIDFromString "{0C539790-12E4-11CF-B661-00AA004CD6D8}", SID_SApplicationObject
      Set pUnk = Excel.Application
      pUnk.QueryInterface IID_IServiceProvider, IServiceProvider
      IServiceProvider.QueryService SID_SApplicationObject, IID_IOleUndoManager, ppv
      End Sub

      Any help will be much appreciated Regards.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      jaafar tribak wrote:

      First of all, I would like to apologize for posting this question in the C++ forum as it deals with Classic VB (VBA) ... The reason I posted here is because I can't get an answer (not even a hint) in the VB/VBA foums ... I searched the web extensively but without any luck

      I do not see where you've asked this question in the VB forum.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      J 1 Reply Last reply
      0
      • D David Crow

        jaafar tribak wrote:

        First of all, I would like to apologize for posting this question in the C++ forum as it deals with Classic VB (VBA) ... The reason I posted here is because I can't get an answer (not even a hint) in the VB/VBA foums ... I searched the web extensively but without any luck

        I do not see where you've asked this question in the VB forum.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        J Offline
        J Offline
        jaafar tribak
        wrote on last edited by
        #3

        Hi, I did ask similar questions in the VB and COM forums before and in other websites as well .. but these rather difficult questions often remain ignored or without a propper solution .. I thought VC programmers were more confortable with these type of in depth subjects. The very few vb lines in the above code snippet should be easy to understand by non vb programmers .. I hope that anyone fmiliar with ole/com would hopefully be able to give me (at least) a rough hint Regards.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups