none
use VBA code to create an embedded Excel file in Powerpoint But the object has no icon RRS feed

  • Question

  • Hello,

    I use the following code to create OLEobject as embedded file in Powerpoint. However, after upgrade to WIN7, the embedded files created by the code have no icon displayed. I am using Office 2007.

    If anyone can explain the reason of this issue?

    Thanks!!

    Sub AddObj(Snum As Integer, Pleft As Integer, Ptop As Integer)
    Dim oSld As Slide
    Dim oShp As PowerPoint.Shape
    
    Set oSld = PPTPres.Slides(Snum)
    Set oShp = oSld.Shapes.AddOLEObject(Left:=400, _
        Top:=400, _
        Width:=100, _
        Height:=100, _
        Filename:=FilePath, _
        displayasicon:=msoCTrue, _
        Link:=msoFalse)
    
    oShp.Left = Pleft
    oShp.Top = Ptop
    
    
    End Sub
    


    Monday, October 7, 2013 4:46 PM

All replies

  • Hi,

    Which type of file you inserted into your PowerPoint document?

    I try to reproduce your issue in my side (Windows 7 + Office 2007), the embedded files can be

    inserted into PowerPoint document and the icon displayed normally.

    I think the issue should be related to the default icon of program which is associated with the file

    type you inserted.

    I recommend you to check whether the default icons of that program is set up property.

    You can go to MS support to get more information:

    http://support.microsoft.com/kb/2422299

    Regard & Thanks,

    • Edited by Mercop002 Tuesday, October 8, 2013 8:27 AM
    Tuesday, October 8, 2013 8:25 AM
  • Thanks Mercop,

    I've checked the default icons and they are good. One more thing I want to share is that when I insert a file object manually, the icon shows correctly. So I think it might be the problem with the code or library?

    Thank you!

    Tuesday, October 8, 2013 3:17 PM
  • The file are Excel spreadsheets and PDF files. Non of them have icon if I use the code to generate them. But if I insert them manually, there would be icons.
    Tuesday, October 8, 2013 5:06 PM