Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Run-Time Error 462

I am exchanging data between Excel and Word (as an HTML document). I insert
a new table into word and then set the column widths. Periodically I get the
following error:
Run-time error €˜462:
The remote server machine does not exist or is unavailable.

The error only happens sometimes. In order to avoid getting this error
again, I must close Excel and Word and rerun the macro. Does anyone know why
this error sporadically appears and what I can do to avoid it? The code in
question is below.

Tx,

Randall


Set WD = CreateObject("Word.Application") 'Microsoft Word Object
WD.Visible = True
WD.Documents.Add DocumentType:=1 'Create New Web Page Document
Set MainDoc = WD.Selection

'Put in Table
MainDoc.Tables.Add Range:=MainDoc.Range, NumRows:=1, NumColumns:=3,
DefaultTableBehavior:=wdWord9TableBehavior
With MainDoc.Tables(1)

'**** The Next Line gives the error
.Columns(1).PreferredWidth = InchesToPoints(2.8)
.Columns(2).PreferredWidth = InchesToPoints(1.7)
.Columns(3).PreferredWidth = InchesToPoints(1.7)

End With









  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Run-Time Error 462

Hi,

I have not reproduced the problem, but I guess the cause is that the
target object of the InchesToPoints method is omitted. you can get
information about the error message on the web.

You may receive the "Run-time error '-2147023174' (800706ba)" error
message or the "Run-time error '462'" when you run Visual Basic code
that uses Automation to control Word in Office XP Developer and in
Office 2000 Developer
http://support.microsoft.com/kb/189618/EN-US/

--
HTH,

okaizawa


Randall wrote:
I am exchanging data between Excel and Word (as an HTML document). I insert
a new table into word and then set the column widths. Periodically I get the
following error:
Run-time error $B!F(B462$B!G(B:
The remote server machine does not exist or is unavailable.

The error only happens sometimes. In order to avoid getting this error
again, I must close Excel and Word and rerun the macro. Does anyone know why
this error sporadically appears and what I can do to avoid it? The code in
question is below.

Tx,

Randall


Set WD = CreateObject("Word.Application") 'Microsoft Word Object
WD.Visible = True
WD.Documents.Add DocumentType:=1 'Create New Web Page Document
Set MainDoc = WD.Selection

'Put in Table
MainDoc.Tables.Add Range:=MainDoc.Range, NumRows:=1, NumColumns:=3,
DefaultTableBehavior:=wdWord9TableBehavior
With MainDoc.Tables(1)

'**** The Next Line gives the error
.Columns(1).PreferredWidth = InchesToPoints(2.8)
.Columns(2).PreferredWidth = InchesToPoints(1.7)
.Columns(3).PreferredWidth = InchesToPoints(1.7)

End With

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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 08:01 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"