sydneyguy
asked on
Run-time error '462' word from access on second run through
works fine the first time but on the second time through it throws up a
erroro 462 server not available.
Have been through a fair few sites but still have not come up with a workable solution, may be another set of eyes.
thanks for your help
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim oRange
Dim wdApp As Word.Application
Dim doc As Object
Dim CellSize As Integer
Set wdApp = New Word.Application
Set doc = wdApp.Documents.Add
wdApp.Visible = True
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=10, NumColumns _
:=1, DefaultTableBehavior:=wdWo rd9TableBe havior, AutoFitBehavior:= _
wdAutoFitFixed
Set wdApp = Nothing
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
erroro 462 server not available.
Have been through a fair few sites but still have not come up with a workable solution, may be another set of eyes.
thanks for your help
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim oRange
Dim wdApp As Word.Application
Dim doc As Object
Dim CellSize As Integer
Set wdApp = New Word.Application
Set doc = wdApp.Documents.Add
wdApp.Visible = True
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=10, NumColumns _
:=1, DefaultTableBehavior:=wdWo
wdAutoFitFixed
Set wdApp = Nothing
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the tip have made the adjustment and am making good head way
ASKER
https://www.experts-exchange.com/questions/24993561/word-and-setting-the-table-margins-settign-them-for-cells-with-different-widths.html