locked
Exportando Graficos para o Powerpoint RRS feed

  • Pergunta

  • Caros,

    tenho a seguinte situação:

    Uma planilha Excel com dezenas de gráficos, a partir desta planilha preciso gerar um PPT com os gráficos e textos que são padronizados.

    Já encontrei código na web para fazer a exportação, mas como não entendo nada de Dev não resolveu muito.

    Caso alguem tenha tempo e interesse gostaria de contratar um profissional para realizar este trabalho.

    Quem tiver interesse e experiência entre em contato que envio arquivos de exemplo e detalhes sobre forma de pagamento.

    meu email: cesar@brasilsulnet.com.br

    ate
    Cesar Camargos
    MCSE - MCSA - MCT

     

    segue código que encontrei na web:

     

    '**********************************************************************************
    ' This procedure pushes all Excel charts in the active workbook toPowerPoint Slides
    ' * If a PowerPoint presentation is not open, PowerPoint will belaunched (if
    ' necessary), a new Powerpoint presentation will be created, and theSlides
    ' will be added with all of the Excel charts.
    ' * If PowerPoint is already open, the Excel charts will be appended tothe
    ' active PowerPoint presentation.
    ' * Chart names will be used for slide titles.

    '**********************************************************************************

    Dim PowerPointConn As Object
    Dim CurrentChart As Excel.Chart
    Dim SlideNumber As Integer, INI_File As String

    If ActiveChart Is Nothing Then End

    ' determine if custom or default INI file should be used
    INI_File = IniFileName

    On Error Resume Next
    Set PowerPointConn = GetObject(, "PowerPoint.Application")
    On Error GoTo 0
    If PowerPointConn Is Nothing Then Set PowerPointConn = CreateObject("PowerPoint.Application")
    If PowerPointConn.Presentations.Count = 0 Then
    PowerPointConn.Presentations.Add msoTrue
    PowerPointConn.Visible = msoTrue

    SlideNumber = PowerPointConn.ActivePresentation.Slides.Count + 1

    For Each CurrentChart In Charts
    CurrentChart.CopyPicture
    PowerPointConn.ActivePresentation.Slides.Add Index:=SlideNumber, Layout:=11 ' ppLayoutTitleOnly = 11
    PowerPointConn.ActivePresentation.Slides(SlideNumber).Shapes.Paste

    PowerPointConn.ActivePresentation.Slides(SlideNumber).Shapes(1).TextFrame.TextRange.Text = CurrentChart.Name

    PowerPointConn.ActivePresentation.Slides(SlideNumber).Shapes(2).Height = Val(GetPrivateProfileString32(INI_File, "GENERAL", "PPT Plot Height", "385"))
    PowerPointConn.ActivePresentation.Slides(SlideNumber).Shapes(2).Top = Val(GetPrivateProfileString32(INI_File, "GENERAL", "PPT Plot Top", "115"))
    PowerPointConn.ActivePresentation.Slides(SlideNumber).Shapes(2).Left = Val(GetPrivateProfileString32(INI_File, "GENERAL", "PPT Plot Left", "85"))
    SlideNumber = SlideNumber + 1
    Next CurrentChart

    Set PowerPointConn = Nothing

    End Sub

    terça-feira, 20 de março de 2007 16:45