Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default After pasting a Chart in Word, excel makes a "restart"

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   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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default After pasting a Chart in Word, excel makes a "restart"

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
why do i "sometimes" need to "edit chart object" before "source da Flirty and Blonde Charts and Charting in Excel 1 February 2nd 10 02:07 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
any formula to convert numbers in word form, e.g. "2" as "Two"? Neeraj Excel Worksheet Functions 1 May 26th 08 01:03 PM
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
pasting "links" into Word Documents misso Links and Linking in Excel 0 June 30th 06 07:39 AM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"