运行时错误“13” – types不匹配

我有一个macros,以通过以前select的Excel文件replacePowerPoint中的标签。 不过,我有一个错误

运行时错误“13” – types不匹配

在以下行上:

Destino = ActiveWorkbook.Sheets(SheetDestino).Range(CellDestino).Value 

有没有人可以帮我澄清和纠正?

 Dim pPPTFile As Presentation Dim sld As Slide Dim shp As Shape Dim i As Long Dim j As Long Dim m As Long Dim trFoundText As TextRange Dim ExcelFile Dim exl As Object Dim WB As Workbook Dim WS As Worksheet Set exl = CreateObject("Excel.Application") ExcelFile = exl.Application.GetOpenFilename(, , "Select Excel File") Workbooks.Open FileName:=ExcelFile Set pPPTFile = ActivePresentation Dim Range As Range Dim LineRange As Range Dim Tag As Variant Dim SheetDestino As Variant Dim CellDestino As Variant Dim Destino As Object Set Range = ActiveWorkbook.Sheets("FIM").Range(ActiveWorkbook.Sheets("FIM").Cells(2, 1), ActiveWorkbook.Sheets("FIM").Cells(ActiveWorkbook.Sheets("FIM").Rows.Count, 1).End(xlUp)) For Each LineRange In Range Set Tag = LineRange.Offset(0, 6) MsgBox (Tag) Set SheetDestino = LineRange.Offset(0, 4) MsgBox (SheetDestino) Set CellDestino = LineRange.Offset(0, 5) MsgBox (CellDestino) Destino = ActiveWorkbook.Sheets(SheetDestino).Range(CellDestino).Value MsgBox (Destino) For Each sld In pPPTFile.Slides For Each shp In sld.Shapes If shp.HasTextFrame Then If shp.TextFrame.HasText Then Set trFoundText = shp.TextFrame.TextRange.Find(Tag) If Not (trFoundText Is Nothing) Then m = shp.TextFrame.TextRange.Find(Tag).Characters.Start shp.TextFrame.TextRange.Characters(m).InsertBefore (Destino) shp.TextFrame.TextRange.Find(Tag).Delete End If End If End If If shp.HasTable Then For i = 1 To shp.Table.Rows.Count For j = 1 To shp.Table.Columns.Count Set trFoundText = shp.Table.Rows.Item(i).Cells(j).Shape.TextFrame.TextRange.Find(Tag) If Not (trFoundText Is Nothing) Then m = shp.Table.Rows.Item(i).Cells(j).Shape.TextFrame.TextRange.Find(Tag).Characters.Start shp.Table.Rows.Item(i).Cells(j).Shape.TextFrame.TextRange.Characters(m).InsertBefore (Destino) shp.Table.Rows.Item(i).Cells(j).Shape.TextFrame.TextRange.Find(Tag).Delete End If Next j Next i End If Next shp Next sld Next LineRange