全て、
私は Access を 2003 年から 2007 年にアップグレードする任務を負っています。DB の目的は、Excel スプレッドシートから自動的に生成されるデータのパワー ポイント プレゼンテーションを作成することです。データをインポートすることはできますが、パワー ポイントに生成しようとするとエラーが発生します。Excel スプレッドシートからデータを取得して、PowerPoint プレゼンテーションの表に入力しようとすると、エラーが発生するようです。このコードは他の誰かによって作成されたものであり、2 つのバージョンの違いについては不明です。助けてください!以下はすべてコードの一部です.なぜそれがそのように分かれているのかよくわかりません..申し訳ありません.詳細が必要な場合はお知らせください. 以下のエラーとコードを参照してください。
エラー: 実行時エラー -2147467259 (800004005) オブジェクト 'shape' のメソッド 'table' が失敗しました
'Replace all tags with values from datarow
With shape.Table
.Cell(1, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(1, 1).shape.TextFrame.TextRange.Text, "<ID>", ID)
.Cell(1, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(1, 3).shape.TextFrame.TextRange.Text, "<TITLE>", TITLE)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<STATUS>", status)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<OWNER>", OWNER)
' is part of WBS in cost changes (Perry Sedlar)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<REP>", REP)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<ACTION>", ACTION)
' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<MCE>", MCE)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<ISSUE>", ISSUE)
' is part of WBS in cost changes (Perry Sedlar)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<ACTION>", ACTION)
' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<PM>", PM)0
' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<HA>", HA)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<MP>", MP)
' is part of WBS in cost changes (Perry Sedlar)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<PM>", PM)
' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<LVL>", LVL)
' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 8).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 8).shape.TextFrame.TextRange.Text, "<PROB>", Prob)
.Cell(2, 8).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 8).shape.TextFrame.TextRange.Text, "<EXP>", EXP)
' is part of WBS in cost changes (Perry Sedlar)
.Cell(2, 8).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 8).shape.TextFrame.TextRange.Text, "<LVL>", LVL)
.Cell(3, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(3, 1).shape.TextFrame.TextRange.Text, "<DESCRIPTION>", DESC)
.Cell(4, 10).shape.TextFrame.TextRange.Text = Replace(.Cell(4, 10).shape.TextFrame.TextRange.Text, "<C>", C)
.Cell(4, 10).shape.TextFrame.TextRange.Text = Replace(.Cell(4, 10).shape.TextFrame.TextRange.Text, "<S>", S)
.Cell(4, 10).shape.TextFrame.TextRange.Text = Replace(.Cell(4, 10).shape.TextFrame.TextRange.Text, "<T>", T)
.Cell(4, 10).shape.TextFrame.TextRange.Text = Replace(.Cell(4, 10).shape.TextFrame.TextRange.Text, "<O>", o)
.Cell(2, 8).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 8).shape.TextFrame.TextRange.Text, "<ARO>", Trend_Arrow)
If IssueFileRead = "N" Then ' Check to see if running Issue or Risk.. templates are now different (Perry Sedlar)
' This code is for Risk Slides (Perry Sedlar)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<OCCUR>", OCCUR)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<OCCUR_FACT>", OCCUR_FACT)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<MIT>", MIT)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<MIT_FACT>", MIT_FACT)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<OPP>", OPP)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<OPP_FACT>", OPP_FACT)
.Cell(2, 7).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 7).shape.TextFrame.TextRange.Text, "<IPT>", IPT)
.Cell(2, 7).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 7).shape.TextFrame.TextRange.Text, "<WBS>", WBS)
Else
' This code if for Issue Slides (Perry Sedlar)
.Cell(2, 1).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 1).shape.TextFrame.TextRange.Text, "<REP>", REP)
.Cell(2, 3).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 3).shape.TextFrame.TextRange.Text, "<ACTION>", ACTION) ' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 5).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 5).shape.TextFrame.TextRange.Text, "<PM>", PM) ' Shifted to the left after removing Gov't Rep column (Perry Sedlar)
.Cell(2, 8).shape.TextFrame.TextRange.Text = Replace(.Cell(2, 8).shape.TextFrame.TextRange.Text, "<LVL>", LVL)
End If
End With
End Sub