Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the below macro to copy a table to Powerpoint . But this is copying as an image . When I used CopyBitmapToClipboard true it is throwing an error. My table is a pivot table in QVW. How can this be done?
sub Ops_Dashboard_Automation()
set objPPT = createobject("PowerPoint.Application")
objPPT.Visible = True
set objPresentation = objPPT.Presentations.Add
set v = ActiveDocument.Getvariable("vShowHideAll")
v.SetContent 1,TRUE
ActiveDocument.GetApplication.WaitForIdle
objPresentation.ApplyTemplate("\\template.potx")
Set Doc =ActiveDocument
PPSlideNo = 1
Doc.Fields(FieldName).Clear
Doc.Fields("Business Segment Name").Clear
Set PPSlide = objPresentation.Slides.Add(PPSlideNo,12)
ActiveDocument.GetSheetObject("CH842").CopyBitmapToClipboard
objPPT.Visible = True
PPSlide.Shapes.Paste()
'ActiveWindow.Selection.ShapeRange(PPSlide.Shapes.Count).ZOrder msoBringToFront
set Shape1 = PPSlide.Shapes(PPSlide.Shapes.Count)
With Shape1
.LockAspectRatio = msoTrue
.Height = 40
.Width = 525
.Left = 73
.Top = 290
end with
Set PPSlide = nothing
Set PPPres = nothing
set v = activedocument.Getvariable("vShowHideAll")
v.SetContent 0,TRUE
Doc.Fields(FieldName).Clear
ActiveDocument.GetApplication.WaitForIdle
MsgBox "Export Complete"
End Sub
Hi,
Can you try this?
ActiveDocument.GetSheetObject("CH842").CopyTableToClipboard true