View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default After pasting a Chart in Word, excel makes a "restart"

I don't know why that happens but you could insert a line to disable events
(application.enableevents = false) so that it won't go back the workbook_open
event. Just make sure to enable them again.
--
JNW


"Carlo" wrote:

Hi all

i have following code:
'----------------------------------------------------------
Dim WRDAPP As Word.Application
Dim WRDDOC As Word.Document

Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("C:\Test.doc")

WRDAPP.Visible = true
ActiveSheet.Shapes("chart1").Copy
WRDAPP.Selection.Paste
'----------------------------------------------------------

As soon as following line gets executed: "WRDAPP.Selection.Paste"
excel starts executing:
'----------------------------------------------------------
Private Sub Workbook_Open()
Form_Start.Show
End Sub
'----------------------------------------------------------

Why is this so? Does anyone has a clue?

Cheers Carlo