Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Only get Active Graph

Hello to all,

im writing a macro under VB that export my Graph from my Sheet "TV". Everything works fine, but i want only the

Graph that are Active. Because i have totally 14 Graphs in my Sheet, some have conditions, so that never all 14 Graph

are Active and so i want to export only the Active Graph, that can be 2 or more. But i get every time 14 Sites in my PowerPoint

Sheet and some Sheets are empty with the Text "Keine Daten verfügbar" (No Dates available). But i want only then the 2 or more

Sheets in Power Point. Here are my code, with the "Active" condition.

sub test

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True ' Create a presentation

Set PPPres = PPApp.Presentations.Add

set s=ActiveDocument.Sheets("TV")

charts=s.GetGraphs

for x = lbound(charts) to ubound (charts)

if charts(x).IsActive then                                         --------------------------------------------> ACTIVE

for i = UBound(charts) - 1 To 0 Step -1

   for j= 0 to i 

    if charts(j).getobjectid>charts(j+1).getobjectid then   

    set temp=charts(j+1)  

    set charts(j+1)=charts(j)

      set charts(j)=temp 

        end if

    next

next

END IF

next

for z=lbound(charts) to ubound(charts)

   Set PPSlide = PPPres.Slides.Add(1, 1)

  'PPSlide.Shapes(1).Delete ' removes the title

  'PPSlide.Shapes(1).Delete ' removes the text box

  'Wenn das Chart minimiert ist dann muss es maximiert werden um exportiert zu werden

  IF ActiveDocument.GetSheetObject(charts(z).getobjectid).isMinimized Then

  ActiveDocument.GetSheetObject(charts(z).getobjectid).maximize

  END IF

  ActiveDocument.GetSheetObject(charts(z).getobjectid).CopyBitmapToClipboard

  ActiveDocument.GetSheetObject(charts(z).getobjectid).minimize

  with PPSlide.Shapes.Paste

      .Left = 0

      .Top = 30

      .Width=720

end with

next

PPPres.SaveAs "C:\Test.ppt"

'PPPres.Close

'PPApp.Quit

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

end sub

What is wrong??

Labels (1)
0 Replies