Word2007にVBAモジュールがあり、メインサブがOpenExcelFileサブを呼び出してExcelワークブックを開きます。正常に開きますが、メインのサブでは、特定のチャートを選択してコピーするのに問題があります。次に、チャートを画像として単語に貼り付けます。
Const Fuelpath As String = "\\PATH\Fuel_Price_Screen.xls"
Sub Main()
OpenExcelFile (Fuelpath)
'''This is where I would like to Copy the only Chart on the first Excel Sheet (named "$$Screen,"
'''but I keep getting errors. I would like to paste it into the Word doc called
'''"daily summary automation," which the VBA module is running in.
End Sub
Sub OpenExcelFile(ByVal Filepath As String)
Dim xlApp As Object
xlApp.Application.Visible = True
xlApp.Workbooks.Open (Fuelpath)
End Sub