Hi Jacob,
"tblRS" and "tblUS" are tables. Many rows and many columns. Named areas.
Creating a Word Document I use this code that works just fine and I need to make this for PowerPoint.
Sub MakeWord()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim myVersao As String
myVersao = "1.0"
Dim wordApp As Object
Set wordApp = CreateObject("word.application")
With wordApp
.Documents.Add Template:="", NewTemplate:=False
.Visible = False
With .Selection
.TypeText text:="Test Report"
.Style = wordApp.ActiveDocument.Styles("Title 1")
.Font.Size = 14
.Font.Bold = wdToggle
.Font.Color = wdColorDarkBlue
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.TypeParagraph
.TypeText text:="Created at " + Format(Date, "Long Date")
.TypeParagraph
.TypeText text:="Complimentary Grades"
.Style = wordApp.ActiveDocument.Styles("Title 2")
.TypeParagraph
End With
With .ActiveDocument.Bookmarks
.Add Range:=wordApp.Selection.Range, _
Name:="Grades"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
With .Selection
.TypeParagraph
.TypeParagraph
.TypeText text:="Report prepared by Excel Macro version " + myVersao
.TypeParagraph
End With
End With
AppActivate "Microsoft Excel", False
Application.Goto Reference:="tblRS"
Selection.Copy
wordApp.Selection.Goto Name:="Grades"
wordApp.Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _
Placement:=wdFloatOvertext, DisplayAsIcon:=False
wordApp.ActiveDocument.SaveAs Filename:="Grades " & Month(Date) _
& Year(Date) & ".doc", FileFormat:=wdFormatDocument, LockComments:=False, _
Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
wordApp.Application.Quit
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub