title: Using VBA, Changing text Color in transferring data from XLSM to PPTX
body: <p>I wrote the below macro in VBA to copy data from Excel and then paste it into the last slide of a table in my powerpoint deck. The challenge that I'm running into is that I'm getting an error on when I am trying to change the text color from the default white to black.</p>
  <pre><code>shpTable.TextFrame.TextRange.Font.Color = RGB(0, 0, 0)
  </code></pre>
  <p>Any ideas what I'm doing wrong on this line? All else works well.</p>
  <pre><code>Option Explicit
  
  Dim myFile, Fileselected As String, Path As String, objPPT As Object
  Dim ppApp   As PowerPoint.Application
  Dim ppPres  As PowerPoint.Presentation
  Dim shpTable As PowerPoint.Shape
  Dim activeSlide As PowerPoint.Slide
  
  Sub Button1_Click()
  
  Application.ScreenUpdating = False
  
  Set myFile = Application.FileDialog(msoFileDialogOpen)
  With myFile
      .Title = &quot;Choose Template PPT File.&quot;
      .AllowMultiSelect = False
  If .Show &lt;&gt; -1 Then
      Exit Sub
  End If
      Fileselected = .SelectedItems(1)
  End With
  Path = Fileselected
  
  Dim i As Integer
  
  Set ppApp = New PowerPoint.Application
  i = 1
  
  ppApp.Presentations.Open Filename:=Path  ' 'PowerPointFile = &quot;C:\Test.pptx&quot;
  Set ppPres = ppApp.Presentations.Item(i)
  
  ' for debug
  Debug.Print ppPres.Name
  
  'ppPres.Slides(1).Copy
  'ppPres.ActivePresentation.Slides.Add Index:=ppPres.Slides.Count + 1 'changed paste to add
  
  'Set NewSlide = PowPntApp.ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle)
  
  Set activeSlide = ppApp.ActivePresentation.Slides.Add(Index:=(ppPres.Slides.Count + 1), Layout:=ppLayoutTitle)
  
  Set activeSlide = ppPres.Slides(ppPres.Slides.Count)
  
  activeSlide.Select
  Set shpTable = activeSlide.Shapes.AddTable(3, 3)
  shpTable.Table.Cell(1, 1).Shape.TextFrame.TextRange.Text = ThisWorkbook.Sheets(&quot;Macro&quot;).Range(&quot;F5&quot;)
  shpTable.Table.Cell(1, 2).Shape.TextFrame.TextRange.Text = ThisWorkbook.Sheets(&quot;Macro&quot;).Range(&quot;F6&quot;)
  
  shpTable.Select
  shpTable.Fill.ForeColor.RGB = RGB(211, 211, 211)
  shpTable.TextFrame.TextRange.Font.Color = RGB(0, 0, 0)
  
  Application.ScreenUpdating = True
  Set ppPres = Nothing
  Set ppApp = Nothing
  
  End Sub
  </code></pre>