PowerShell: Copy a table from excel then paste to PowerPoint keeping the source formatting - excel

I have tried to use this command below however It's doing to paste the table to the PowerPoint without the excel source formatting:
#Copy table from excel
$sh.Range("A1", "F3").select()
$xl.Selection.Copy()
#Paste table from excel to PowerPoint
$slide = $pp1.Slides.Item($IntSlide)
$TableTemp1 = $slide.Shapes.PasteSpecial($ppPasteHTML,$false,$null,$null,$null,$null)
Could anyone pls help me with a PowerShell script to copy a table from excel then paste to PowerPoint and keep the formatting?

Related

VBA code to transfer data from excel to powerpoint

Is there any VBA code that can be used to transfer data from the excel sheet onto the powerpoint? Currently, I have some data which has been used to generate a chart in excel and this chart is transferred from the excel to a powerpoint using VBA code.The macro is in the excel workbook. However, I would like to transfer the percentage profit from the excel cell over to the powerpoint either as a text or image as shown in the ppt below using VBA (since it is comparing the profit against the latest week[week 16], it should capture the value inside the cell G7). Is there any VBA code available for that? Are there any ways to proceed with this?
Data in excel sheet
Data I want to transfer to the powerpoint

VBA excel macro to copy only values of a file

i am trying to create a code in VBA that takes each tab of an excel files and paste everything in another file keeping the same formatting but without formulas (only values). Is there an easy way to do this ?

How to use Powershell to paste an excel table into powerpoint while keeping the formatting

I am trying to paste several excel tables into powerpoint using Powershell:
$shape = $slide.Shapes.PasteSpecial($ppPasteJPG,$false,$null,$null,$null,$null)
It seems to work perfectly with two of the 6 excel tables I am pasting, but with the other 4 it does not. The two it works with are .xlsm, whereas the 6 are xlsx. Why is this, and how can I make it work with all of them? How can I paste the selected ranges from the xlsx files into PowerPoint such that they are formatted as they are in excel?
You can paste while keeping source formatting by using the CommandBars.ExecuteMso from either the presentation object or the application object. The command string is "PasteSourceFormatting" so after you've activated the Cell you're trying to insert the table into, run the command:
$pptApplication.CommandBars.ExecuteMso("PasteSourceFormatting");
After you've done that, use Shapes to find the newly inserted table to modify placement, size, etc.

Crashes when pasting excel range as table format in powerpoint

I have tried to copy a excel range and paste as table format in powerpoint using excel vba. It pasting the range but when I resize the table the Powerpoint application is crashing.
Your solution helped me to get rid of chrasing powerpoint application. I wrote the table resize function in powerpoint file and executed it.
Thanks alot...

Copy excel 2010 sheet to another workbook

I have two copies of an Excel 2010 spreadsheet, my copy for editing and the master. I have created a new sheet in my copy which acts as a statistics page, totaling up totals from all other sheets. I wish to transfer this into the master copy. If I use standard copy and paste or the Excel 'Move Sheet' function the formulae copy over but still reference my version of the spreadsheet.
Example
Spreadsheet1 => =sum('sheet1'!A:A)
Spreadsheet2 => =sum('[Spreadsheet1.xlsx]sheet1'!A:A)
Without having to manually go through the master version and edit each field can anyone suggest a way to copy this over without it trying to refer back to the original spreadsheet?
An easy solution (quick n dirty): after copy and paste, replace "[Spreadsheet1.xlsx]" in the new sheet by an empty string

Resources