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#
  4. Not able to assign the picture to toolbar item.

Not able to assign the picture to toolbar item.

Scheduled Pinned Locked Moved C#
helpasp-netcom
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.
  • S Offline
    S Offline
    SRKSHOME
    wrote on last edited by
    #1

    Hi, I have created toolbar for Excel. To one of the toolbar item i am trying associate the image. But it is failing. stdole.IPictureDisp p = AxHost.GetIPictureDispFromPicture(image) as stdole.IPictureDisp; commandBarButton.Picture = p; When I am trying to assigning to command bar picture it is throwing following error. Error HRESULT E_FAIL has been returned from a call to a COM component. (source: Office) Exception info:System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at Microsoft.Office.Core._CommandBarButton.set_Picture(IPictureDisp ppdispPicture) Based on some events this tool bar image is changing. I am not sure why it failing.But same thing is working for menu bar item. Please help.

    RaviBeeR 1 Reply Last reply
    0
    • S SRKSHOME

      Hi, I have created toolbar for Excel. To one of the toolbar item i am trying associate the image. But it is failing. stdole.IPictureDisp p = AxHost.GetIPictureDispFromPicture(image) as stdole.IPictureDisp; commandBarButton.Picture = p; When I am trying to assigning to command bar picture it is throwing following error. Error HRESULT E_FAIL has been returned from a call to a COM component. (source: Office) Exception info:System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at Microsoft.Office.Core._CommandBarButton.set_Picture(IPictureDisp ppdispPicture) Based on some events this tool bar image is changing. I am not sure why it failing.But same thing is working for menu bar item. Please help.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      Are you sure p is not null? /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        Are you sure p is not null? /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        S Offline
        S Offline
        SRKSHOME
        wrote on last edited by
        #3

        Yes..It is not null.

        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