Solved

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

Posted on 2010-09-08
4
941 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 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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