Unescpected gray thin lines appear when an image is pasted from Excel to Powerpoint RRS feed

  • Pergunta

  • Guys,

    I have a problem with the .CopyPicture and .PasteSpecial.

    When the macro pastes the picture, a gray and thin border appears with the image.

    I'm copying many Excel objects and images, but it appears just in the chart image into Powerpoint, and I cannot crop the image because the other objects.

    Sample code below:

    Sub GerarSlides()
        Application.ScreenUpdating = False

        Dim objPPT As Object
        Dim grafico(3) As String
        Dim intSlide, cont As Integer
        Dim nomearquivo, desktoppath As String
        Dim objPres As Object
        grafico(1) = "P0 e P1"
        grafico(2) = "P2"
        grafico(3) = "P3"

        Set objPPT = CreateObject("Powerpoint.application")
        objPPT.Visible = True

        Set objPres = objPPT.Presentations.Add
        objPres.Slides.Add 1, 1 'ou use ppLayoutText

        objPPT.ActiveWindow.ViewType = 1
        ActiveWindow.DisplayGridlines = False

        For cont = 1 To 3
            Plan4.Cells(2, 3) = grafico(cont)
            Plan2.Range("A1", Plan2.UsedRange).Borders.LineStyle = xlNone 'it doesn't work

            Plan2.Range("A1", Plan2.UsedRange).BorderAround (xlLineStlyeNone)
            Plan2.Range("A1", Plan2.UsedRange).CopyPicture Appearance:=xlScreen, Format:=xlPicture

       Next cont
    Application.ScreenUpdating = True
    End Sub

    So please, I need help for this threat, to remove the gray thin lines.

    Best Regards,


    • Editado Ricardo Dezan quarta-feira, 5 de fevereiro de 2014 17:35
    quarta-feira, 5 de fevereiro de 2014 16:41

Todas as Respostas