1

我在 Word2007 中有一个 VBA 模块,它有一个主子,它调用一个 OpenExcelFile 子来打开一个 Excel 工作簿。它成功打开,但是在我的主子中,我无法选择和复制特定图表。然后我想将图表作为图片粘贴到 word 中。

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
4

0 回答 0