copy and tweak cells to Powerpoint by macro

erestel

New Member
Joined
Oct 27, 2013
Messages
3
I want to copy I2:J3 to Powerpoint, centre-align it, and set the table's height and width. The Excel cells are formatted as is required, so I would prefer copying the entire thing and paste as Table in PPT (instead of an source-linked image as PasteSpecial would result in). I am using Office 2010

I managed to go as far as using the following to "Keep Source Formatting" I found at another help site
Code:
PPApp.CommandBars.ExecuteMso ("PasteSourceFormatting")

After pasting the table is the actively selected element. However, everything I have tried to format it result in one error or another. I cannot seem to use "Shapes" or "Items" to manipulate the qualities I am trying to. Please advise.

I am fine with whatever code that works, but for those who are interested, most bizarrely, I found the following to be working--kind of. I inserted the MessageBox as part of debugging, and found that the code would only work with the message box exactly as it is. Changing the content of the box, or moving it elsewhere would result in an error; so would (assuming somehow the system needs to Count the shapes) using opening an Integer to hold the result of Count.
Code:
With PPPres.Slides(1).ShapesDim i As Integer
For i = 1 To .Count


MsgBox (PPPres.Slides(1).Shapes.Count)


If .Item(i).HasTable Then


.Item(i).Width = 374
.Item(i).Height = 91


End If
Next i
End With
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top