Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Error 4605 when trying to copy/paste a table from excel to word.

Hi,
Sometimes, I get an error when I try to copy a table in excel and paste it
into Word. Normally, there's no error or if there's an error, the second
time, it will work. For some user, it doesn't work (even after 10 try). Does
anyone have an idea? It seems to be related to specific computer (the macro
run if I run it from a server or another computer).
Thank you!
Alex


iErr = 0
On Error Resume Next
300: ThisWorkbook.Activate

Err.Clear
oXlRng.Copy
docWord.Activate
iP = docWord.Paragraphs.Count
Set oRange = docWord.Paragraphs(iP).Range
oRange.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False,
RTF:=False

If Err = 4605 Then
iErr = iErr + 1
If iErr = 10 Then
MsgBox "Error creating " & sTitle1, vbExclamation, "Message"
Exit Function
End If
GoTo 300
End If
On Error GoTo 0



--
Alex St-Pierre
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Error 4605 when trying to copy/paste a table from excel to word.

Hope Macro security is turned to low to enable macros in the user computer...

ToolsMacroSecurity.. Set to low/medium...

If this post helps click Yes
---------------
Jacob Skaria


"Alex St-Pierre" wrote:

Hi,
Sometimes, I get an error when I try to copy a table in excel and paste it
into Word. Normally, there's no error or if there's an error, the second
time, it will work. For some user, it doesn't work (even after 10 try). Does
anyone have an idea? It seems to be related to specific computer (the macro
run if I run it from a server or another computer).
Thank you!
Alex


iErr = 0
On Error Resume Next
300: ThisWorkbook.Activate

Err.Clear
oXlRng.Copy
docWord.Activate
iP = docWord.Paragraphs.Count
Set oRange = docWord.Paragraphs(iP).Range
oRange.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False,
RTF:=False

If Err = 4605 Then
iErr = iErr + 1
If iErr = 10 Then
MsgBox "Error creating " & sTitle1, vbExclamation, "Message"
Exit Function
End If
GoTo 300
End If
On Error GoTo 0



--
Alex St-Pierre

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
Copy / paste from a table in word .doc to excel .xls worksheet Paul Excel Discussion (Misc queries) 1 April 29th 07 03:58 PM
Run time error '4605' while copying excel range as picture in Wor Samirkc Excel Programming 0 July 27th 06 03:45 PM
How do I copy selected cells in excel and paste into word table REVA Excel Programming 2 January 4th 06 09:43 PM
Q: copy/paste table from Word JIM.H. Excel Discussion (Misc queries) 0 November 5th 05 04:57 PM
Copy & Paste table from Excel to Word Johnny37 New Users to Excel 1 October 10th 05 06:26 PM


All times are GMT +1. The time now is 08:14 AM.

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

About Us

"It's about Microsoft Excel"