S
Simon Lloyd
Hi all i have some code below that opens Word adds a document and pastes
the contents of a range in to it, my problem is that i would like the
contents to be pasted on the right hand side if the document, thats
what the vbTab's are for below but it doesnt work it just hangs after
running that line........i'm no whizz at this so if anyone could give
me the correction i would be very grateful!
Regards,
Simon
Sub wrdstart()
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
..documents.Add
Selection.TypeText Text:=vbTab & vbTab & vbTab & vbTab & vbTab & vbTab
& _
vbTab & vbTab & vbTab
Range("A1:A5").Copy
..Selection.Paste
End With
End Sub
the contents of a range in to it, my problem is that i would like the
contents to be pasted on the right hand side if the document, thats
what the vbTab's are for below but it doesnt work it just hangs after
running that line........i'm no whizz at this so if anyone could give
me the correction i would be very grateful!
Regards,
Simon
Sub wrdstart()
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
..documents.Add
Selection.TypeText Text:=vbTab & vbTab & vbTab & vbTab & vbTab & vbTab
& _
vbTab & vbTab & vbTab
Range("A1:A5").Copy
..Selection.Paste
End With
End Sub