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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Export a Straight Table to Power Point (PPT) using Macro


Hi All,

I need to export one Straight Table to a Power Point [may be using a button] using Macro.

Any valuable suggestions will be appreciated.

Regards!!!

12 Replies
jerem1234
Specialist II
Specialist II

Here try this

sub ppt

  set objPPT = CreateObject("PowerPoint.Application")

  objPPT.Visible = True

  Set objPresentation = objPPT.Presentations.Add

  ActiveDocument.Sheets("SH01").Activate

  Set obj = ActiveDocument.GetSheetObject("CH05")

  Set PPSlide = objPresentation.Slides.Add(1,obj.GetObjectType)  

  obj.CopyValuesToClipboard

  PPSlide.Shapes.Paste

End Sub

Not the best looking since it just copies the values, but powerpoint seems to have trouble pasting the table.

Hope this helps!

jerem1234
Specialist II
Specialist II

Finally got it, however it will only work with PowerPoint 2010 and greater. They added a command to keep source formatting in this version which works with the copied table. Try this set of code:

sub ppt

  set objPPT = CreateObject("PowerPoint.Application")

  objPPT.Visible = True

  Set objPresentation = objPPT.Presentations.Add

  ActiveDocument.Sheets("SH01").Activate

  Set obj = ActiveDocument.GetSheetObject("CH01")

  Set PPSlide = objPresentation.Slides.Add(1,obj.GetObjectType)  

  obj.CopyTableToClipboard true

  With PPSlide

  objPPT.CommandBars.ExecuteMso ("PasteSourceFormatting")

  End With

End Sub

Hope this helps!

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hey Jerem,

That's a great effort and much helpful solution. This is what I needed. Cheers for you!!!

Regards!