Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JNW
Thanks a lot, that did the job! Still don't know why that happens. Thanks again Carlo "JNW" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
why do i "sometimes" need to "edit chart object" before "source da | Charts and Charting in Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
any formula to convert numbers in word form, e.g. "2" as "Two"? | Excel Worksheet Functions | |||
Check if cells contain the word "Thailand", return "TRUE" | Excel Worksheet Functions | |||
pasting "links" into Word Documents | Links and Linking in Excel |