Когда я вставляю диапазон Excel в PowerPoint, мой код меняет формат текста, особенно размер шрифта. Как вставить таблицу, сохранив исходный формат?
{
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim shp As Object
'Opening PPT and creating a new presentation
Set ppApp = New PowerPoint.Application
Set ppPres = ppApp.Presentations.Add
'Add and select new slide
Set ppSlide = ppPres.Slides.Add(1, ppLayoutBlank)
ppSlide.Select
'Copy range from excel sheet
Sheets("ToPPT").Range("B2:P30").Copy
DoEvents
'Paste range as html
Set shp = ppSlide.Shapes.PasteSpecial(DataType:=ppPasteHTML)
With ppPres.PageSetup
shp.Width = .SlideWidth
shp.Height = .SlideHeight
End With
'adjust position in slide
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignTops, msoTrue
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignLefts, msoTrue
}