Hey guys.
I've made a script where you can load/import an excel file and paste this in word.
Here is the code:
Now here comes my issue. Once I copy+paste rows A to J, all works well. But once field row A overlaps row B because of the width of the text, it puts it on the next line.Code:Private Sub CommandButton2_Click() Dim lngCount As Long i = 1 With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = False .Show For lngCount = 1 To .SelectedItems.Count OpenExcelWorkbook .SelectedItems.Item(lngCount) Next lngCount End With End Sub Public Sub OpenExcelWorkbook(file As String) Dim app As Object Dim workbook As Object Set app = CreateObject("Excel.Application") Set workbook = app.Workbooks.Open(file) app.Sheets("Blad1").Range("A:J").Copy End Sub Private Sub plakexcel() Selection.GoTo What:=wdGoToPage, Count:=8 Selection.MoveDown Unit:=wdLine, Count:=10 Selection.PasteAndFormat (wdPasteDefault) Selection.MoveUp Unit:=wdLine, Count:=1 sluiten End Sub
Or when row A to J are filled with text it pushes it off to the edge of the document.
Do you guys have any better methods to 'import' excel rows A to J in word?
Thanks in advance.




Reply With Quote