excel_learnerz
Board Regular
- Joined
- Dec 12, 2018
- Messages
- 73
Hello
With the below code I can export used ranged as table into Microsoft word.
When it goes to word the table isn't autofitted, so half of it is not appearing correctly.
Is there a way for it to be formatted correctly in the word document
Thanks in advance
Sub annex()
With Sheets("Sheet1").Select
Set obj = CreateObject("Word.Application")
obj.Visible = True
Set newObj = obj.Documents.Add
ActiveSheet.UsedRange.Copy
newObj.Range.Paste
Application.CutCopyMode = False
obj.Activate
newObj.SaveAs Filename:="C:\temp" & ActiveSheet.Name
End With
End Sub
With the below code I can export used ranged as table into Microsoft word.
When it goes to word the table isn't autofitted, so half of it is not appearing correctly.
Is there a way for it to be formatted correctly in the word document
Thanks in advance
Sub annex()
With Sheets("Sheet1").Select
Set obj = CreateObject("Word.Application")
obj.Visible = True
Set newObj = obj.Documents.Add
ActiveSheet.UsedRange.Copy
newObj.Range.Paste
Application.CutCopyMode = False
obj.Activate
newObj.SaveAs Filename:="C:\temp" & ActiveSheet.Name
End With
End Sub