Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!!!
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!
Hi All,
I used the below Macro. Its getting functioned properly.
Sub Export()
set obj = ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "C:\Users\dicky\Documents\Export.ppt"
End Sub
But afterwards am unable to open the desired PPT. Its throwing below error. Please suggest.
Any help please???
Here 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)
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard
PPSlide.Shapes.Paste
End Sub
This should open up your Powerpoint with the image pasted, then you can save it wherever.
Hope this helps!
Along with the "Jerem1234" code, make sure to set the module security to "System Acess" & Local security to "allow system access" in macro editor.
Great Mr. Phani...
Your solution was just a finishing touch.
Could you please let me know the functionality of the solution you have suggested?
Regards!!!
Thanks a lot Jerem,
This really helped along with the solution provided by Phaneendra.
Kudos to both!!!
Would you mind marking this discussion as correct/helpful so that others may find this as useful.
Thanks!
Hi Jerem and Phani,
The exported thing to PPT was just a screenshot of the Straight Table. Users can't se the full set of records.
Now my requirement is to send the full records to PPT and that too in editable mode. Users can change the values of their own too.
Something like in this attached example. Please help.
Regards!!
Hmm... I rewrote the code, but I am having trouble pasting it in PowerPoint. Seems like PPSlide.Shapes.Paste isn't doing the trick. The code below will copy table to clipboard, and you can manually hit paste or cntrl-v in the powerpoint, but for some reason the PPSlide.Shapes.Paste isn't working. The code I have is below:
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
'PPSlide.Shapes.Paste
End Sub
Maybe someone else can resolve this issue?