?
Solved

Word 2007 VBA - Error 462 Remote Server Machine Does Not Exist???

Posted on 2010-09-08
4
Medium Priority
?
942 Views
Last Modified: 2013-11-27
I am using Access 2007 to create and populate a word doc.  It works great if I use this code:
objDoc.Application.Selection.TypeParagraph
Set objTable = objDoc.Tables.Add(objDoc.Application.Selection.Range, i + 1, 2)
'Setup Table properties
With objTable
    .AllowAutoFit = True
    .AutoFitBehavior wdAutoFitContent
    .BottomPadding = 0
    .TopPadding = 0
    .Rows.SetHeight 13, wdRowHeightExactly
    .Range.Font.Bold = False
End With

But as soon as I add the .Columns(2).PreferredWidth = InchesToPoints(2) as shown below, I get an error 462 - Remote Server Machine Does Not Exist??? Any thoughts would be appreciated!
objDoc.Application.Selection.TypeParagraph
Set objTable = objDoc.Tables.Add(objDoc.Application.Selection.Range, i + 1, 2)
'Setup Table properties
With objTable
    .AllowAutoFit = True
    .AutoFitBehavior wdAutoFitContent
    .BottomPadding = 0
    .TopPadding = 0
    .Rows.SetHeight 13, wdRowHeightExactly
    .Range.Font.Bold = False
    .Columns(2).PreferredWidth = InchesToPoints(2)
End With
0
Comment
Question by:CFrasnelly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 2000 total points
ID: 33631899
CFrasnelly,


InchesToPoints is a function within Word, Publisher, and Excel, but not Access. Try

.Columns(2).PreferredWidth = objDoc.Application.InchesToPoints(2)

and see if that resolves it.

HTH, pT72
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33632130
From the help - Converts a measurement from inches to points (1 inch = 72 points). Returns the converted measurement as a Single

So could you not specify points? or create your own inchestopoints method
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33632144
eg simple with no validation

Public Function InchesToPoints(inches As Single) As Single
    InchesToPoints = inches * 72
End Function
0
 

Author Closing Comment

by:CFrasnelly
ID: 33632149
That worked! No wonder you're a master! :-)

Thanks again!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question