B
Bryan Lenker
I'm guessing you want to open an excel workbook from
inside word using VBA. This code might help you get
started:
Dim wb As Workbook
Application.ScreenUpdating = False
Set wb = Workbooks.Open("c:\excel file.xls"))
'copy your chart to the clipboard
wb.Close False
Set wb = Nothing
'paste your chart into word
Application.ScreenUpdating = True
This code will open an excel file, but will keep it
hidden so the user can't see it being opened. I'm not
sure where the chart is located, but you should be able
to access the chart through VB and then copy it. Once
you have it copied, close excel and make word the active
app. Then you should be able to paste the chart.
If you have any problems, try recording a macro to
accomplish the same thing. Doing that sometimes gives
you some good hints...hope this helps.
inside word using VBA. This code might help you get
started:
Dim wb As Workbook
Application.ScreenUpdating = False
Set wb = Workbooks.Open("c:\excel file.xls"))
'copy your chart to the clipboard
wb.Close False
Set wb = Nothing
'paste your chart into word
Application.ScreenUpdating = True
This code will open an excel file, but will keep it
hidden so the user can't see it being opened. I'm not
sure where the chart is located, but you should be able
to access the chart through VB and then copy it. Once
you have it copied, close excel and make word the active
app. Then you should be able to paste the chart.
If you have any problems, try recording a macro to
accomplish the same thing. Doing that sometimes gives
you some good hints...hope this helps.