Solved

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

Posted on 2010-09-08
4
933 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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