I'm currently trying to create a calendar in powerpoint using powershell. All I want to do is insert a table into a powerpoint slide. This table is representing the month of January, it contains the days of the week etc.
I did some research and came across this.
This is VB script, so i tried to "create its equivalent" in powershell:
EDIT3: I was finally able to copy my table from Excel and paste it into my powerpoint slide using this code:
#Create an instance of Excel.
$xl=New-Object -ComObject "Excel.Application"
$xl.Visible = $True
#Open the Excel file containing the table.
$wb = $xl.workbooks.open("C:\January.xls")
$ws = $wb.ActiveSheet
#Select the table.
$range = $ws.range("A1:G7")
$range.select()
#Copy the table to the clipboard.
$range.copyPicture()
#Create an instance of Powerpoint.
$objPPT = New-Object -ComObject "Powerpoint.Application"
$objPPT.Visible ='Msotrue'
#Add a slide to the presentation.
$project = $objPPT.Presentations.Add()
$slide = $project.Slides.Add(1, 1)
#Paste the table into the slide.
$shape = $slide.Shapes.Paste()
#Position the table.
$shape.Left = 50
$shape.Top = 150
$shape.Width = 300
$shape.Height = 168
Thanks to those who have helped me here and on #powershell